Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to get a hidden value from product_info.php to shopping_cart.info


Recommended Posts

Posted

Hi all :)

 

Firstly I am new to php / mysql but am familiar with asp / access so I do understand some things! Also, I am not too sure if I should post this here or in the contrib forums

 

I am trying to make a (what will be) contribution that allows a user to set the minimum quantity to prurchase for each item - there is a contrib that sets a default for all items, but I need to be able to set different minimum quantities for each item.

 

I have made the chages to the products table, and through the admin I can set the minimum for each product, change it and delete it.

 

In the catalog I can get, on the product_info.php page it to say "This product requires a minimum purchase of XXX" where XXX is the number set in the admin.

 

Now, in the code part for the add to cart button I have added the products_min_qty bit in the following code (about line 260):

 

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_hidden_field('products_min_qty', $product_info['products_min_qty']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

 

If I do a view source, the right value is there.

 

How do I get the value in the shopping cart? I have tried various things but I can not pull it through! I need somehow to have it as part of the info for each product in the shopping cart so if a user tries to lower the quantity below the minimum they will not be able to do it.

 

Any advise and help would be GREATLY appreciated!!!! :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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