Jump to content

Archived

This topic is now archived and is closed to further replies.

downfall

Help with making a Product Database

Recommended Posts

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?

Share this post


Link to post
Share on other sites
No, in a word.

At the time you create that link, no size has been selected.

Share this post


Link to post
Share on other sites
On reflection, you might be able to do it with AJAX, creating the link code when the size is selected

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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_________stock

Ok.. 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 Stock

And 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 0

BUT, 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?

Share this post


Link to post
Share on other sites
anyone??

or barrand, could you give me more help with the coding you done with the dropdown menu with the added AJAX you mentioned??

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.