Jump to content

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?
  • Replies 81
  • Created
  • Last Reply

Top Posters In This Topic

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?
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

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.