Jump to content


Help with making a Product Database

  • Please log in to reply
81 replies to this topic

#81 downfall

  • Members
  • PipPipPip
  • Advanced Member
  • 61 posts

Posted 05 October 2006 - 02:53 PM

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.c...oduct={$product['band_name']} - {$product['product_name']} ({$product['category_name']}) Small &price={$product['product_price']}">Small - Buy Now</a>
<a href="http://ww6.aitsafe.c...oduct={$product['band_name']} - {$product['product_name']} ({$product['category_name']}) Medium &price={$product['product_price']}">Medium - Buy Now</a>
<a href="http://ww6.aitsafe.c...oduct={$product['band_name']} - {$product['product_name']} ({$product['category_name']}) Large &price={$product['product_price']}">Large - Buy Now</a>
<a href="http://ww6.aitsafe.c...oduct={$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:


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.c...oduct={$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.c...oduct={$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?

#82 downfall

  • Members
  • PipPipPip
  • Advanced Member
  • 61 posts

Posted 05 October 2006 - 06:35 PM


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

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users