downfall Posted October 4, 2006 Author Share Posted October 4, 2006 Brilliant!! One last thing, you may notice at the bottom of my code this "buy now" link which goes to my checkout:<a href="http://ww6.aitsafe.com/cf/add.cfm?userid=88166920&product={$product['band_name']} - {$product['product_name']} ({$product['category_name']})&price={$product['product_price']}">Buy Now</a>If you go to that link you can see it nicely echos the band product, band name, prod cat and product price. Is there a way by whatever is selected i the size dropdown gets echoed, so I can add the echoed size into the link above? Quote Link to comment https://forums.phpfreaks.com/topic/22382-help-with-making-a-product-database/page/4/#findComment-103997 Share on other sites More sharing options...
Barand Posted October 4, 2006 Share Posted October 4, 2006 No, in a word.At the time you create that link, no size has been selected. Quote Link to comment https://forums.phpfreaks.com/topic/22382-help-with-making-a-product-database/page/4/#findComment-104001 Share on other sites More sharing options...
Barand Posted October 4, 2006 Share Posted October 4, 2006 On reflection, you might be able to do it with AJAX, creating the link code when the size is selected Quote Link to comment https://forums.phpfreaks.com/topic/22382-help-with-making-a-product-database/page/4/#findComment-104005 Share on other sites More sharing options...
downfall Posted October 4, 2006 Author Share Posted October 4, 2006 How would I go about with doing that.. AJAX is something I haven't heard of.Otherise, I'm just going to need to think how I can get round this. Either way, what you've done for me is great! Quote Link to comment https://forums.phpfreaks.com/topic/22382-help-with-making-a-product-database/page/4/#findComment-104010 Share on other sites More sharing options...
Barand Posted October 4, 2006 Share Posted October 4, 2006 See the link in my sig Quote Link to comment https://forums.phpfreaks.com/topic/22382-help-with-making-a-product-database/page/4/#findComment-104013 Share on other sites More sharing options...
downfall Posted October 5, 2006 Author Share Posted October 5, 2006 Ok, I' thought about how I should be able to get this to work, in theory,It is essential that the buy now link contains the size the customer chooses, along with product name, band, price etc. that I already have in it. This is because with Mal's cart, all the information about what they order must be in that buy now link, as that is exactly is what emailed to me when the order is compelted, so I need to know the size in that along with the other info so I know exactly what that to ship to them!So this is how I think I can do this, replacing the dropdown menu sizes for direct link sizes. I need to premake a Buy Now link like I showed in a prev post with each size included, so i have 4 buy now buttons, one for each size like this:<a href="http://ww6.aitsafe.com/cf/add.cfm?userid=88166920&product={$product['band_name']} - {$product['product_name']} ({$product['category_name']}) Small &price={$product['product_price']}">Small - Buy Now</a><a href="http://ww6.aitsafe.com/cf/add.cfm?userid=88166920&product={$product['band_name']} - {$product['product_name']} ({$product['category_name']}) Medium &price={$product['product_price']}">Medium - Buy Now</a><a href="http://ww6.aitsafe.com/cf/add.cfm?userid=88166920&product={$product['band_name']} - {$product['product_name']} ({$product['category_name']}) Large &price={$product['product_price']}">Large - Buy Now</a><a href="http://ww6.aitsafe.com/cf/add.cfm?userid=88166920&product={$product['band_name']} - {$product['product_name']} ({$product['category_name']}) Extra Large &price={$product['product_price']}">Extra Large - Buy Now</a>Obviosuly the above requires no php and is a very basic way of doing it.Now if like before, certain buy now links dissapear when I size has a value of 0 in the prod_stock table, that would be fantastic!!For example:this is my prod_stock table:stock_id_________product_id__________size_________stockOk.. for example, something like this would be great:IF product_id has size "small" in the "size" field, then display Small - Buy Now link IF it has "stock" greater then 0:<a href="http://ww6.aitsafe.com/cf/add.cfm?userid=88166920&product={$product['band_name']} - {$product['product_name']} ({$product['category_name']}) Small &price={$product['product_price']}">Small - Buy Now</a>OR if it has size "small" in the "size" field but with 0 stock then show instead:Currently Out Of StockAnd just loop it all so it checks if theres a medium, large, and extra large size in the size field and either output the buy now link or the out of stock link depending if stock is greater then 0BUT, if there is no size in the "size" field, which will happen when a product only has one fit (eg. hat) or not nessessary (calender/poster), then this buy now link with no size in the link should appear (if stock greater then 0):<a href="http://ww6.aitsafe.com/cf/add.cfm?userid=88166920&product={$product['band_name']} - {$product['product_name']} ({$product['category_name']})&price={$product['product_price']}">Buy Now</a>and again, if no stock, then this message:Currently Out Of Stock-------------That probably sounds complicated but hopefully isn't too hard!! Can anyone help me to do the above? Quote Link to comment https://forums.phpfreaks.com/topic/22382-help-with-making-a-product-database/page/4/#findComment-104230 Share on other sites More sharing options...
downfall Posted October 5, 2006 Author Share Posted October 5, 2006 anyone??or barrand, could you give me more help with the coding you done with the dropdown menu with the added AJAX you mentioned?? Quote Link to comment https://forums.phpfreaks.com/topic/22382-help-with-making-a-product-database/page/4/#findComment-104446 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.