Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding (different) Quantity to shopping cart?


outpost7

Recommended Posts

Hello,

 

I have set up the shopping cart a little different, I am using the quantity to tell people how many of something there are per pkg. but I would like to display that in the shopping cart so they can see how many they have and how many there are per pkg.

 

I have tried for hours to figure this out, various querys yet I am unable to get it to work properly. Does anyone have any suggestions or work arounds to this problem?

 

Thanks in advance for the help..... :!:

Link to comment
Share on other sites

Have you considered using option attributes for varies QTY choices. A package is still one or two packages. so the QTY should be left to representing entire packages not the qty of items in it.

 

IMHO.

 

The attributes are cool for showing the various innerds of a product. You could have a option like:

QTY:  

Bottles: 6, 12 +$3.00, 24 +$6.00

becuase options can carry prices even to subtract from the product price they jut might do the trick.

 

You could hire a php programmer to hack it out for you.

Best Regards,

 

Salvatore Iozzia

 

Loaded Commerce - Oscommerce - All Loaded Up.

Link to comment
Share on other sites

Problem with attributes is then the user has to go to the product_info page instead of just being able to add the product from the index page.

 

I am fairly good with PHP, but I have tried alot of options here and none seem to work.

 

No to attributes

No to pulling quantity from $product[$i]['quantity'] - thats just the number of items they have added, what I have tried is:

 

modifing the checkout_process.php and includes/class/orders.php to contain the variable perpkg, yet when I pull it in, I get nothing:

$product[$i]['perpkg']

 

again, any suggestions or contributions for this issues would really help,

 

Thanks

Link to comment
Share on other sites

Incase anyone wants to add quantity to the cart without adding it as an attribute, I have put this here for future reference:

 

includes/modules/order_details.php

 

line:58 change to:

// Product name, with or without link

 if (strstr($PHP_SELF, FILENAME_SHOPPING_CART)) {

   echo '    <td valign="top" class="main"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'], 'NONSSL') . '"><b>' . $products[$i]['model'] . '</b></a> - <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id'], 'NONSSL') . '">' . $products[$i]['name'] . '</a> - ' . $products[$i]['perpkg'] . ' per pkg';

 

includes/classes/order.php

 

line:86 change to:

      $index = 0;

     $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, products_perpkg, final_price from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . tep_db_input($order_id) . "'");

     while ($orders_products = tep_db_fetch_array($orders_products_query)) {

       $this->products[$index] = array('qty' => $orders_products['products_quantity'],

               'perpkg' => $orders_products['products_perpkg'],

                                       'name' => $orders_products['products_name'],

                                       'model' => $orders_products['products_model'],

                                       'tax' => $orders_products['products_tax'],

                                       'price' => $orders_products['products_price'],

                                       'final_price' => $orders_products['final_price']);

 

i believe that is the only two places I changed, if you have any problems let me know.

Link to comment
Share on other sites

  • 1 year later...

Archived

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

×
×
  • Create New...