Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I've tried to install this module several times making sure I did everything right and it still doesn work has anyone had any luck with this, My boss is up my butt to get this working, we sell fabric and now he wants to sell 1/4 yards and 1/2 yards, so people can order and add a half yard to their total I've tried attributes but you select the attribute before adding the quantity and that causes the attribute to added more that once, I also have the auto update cart mod so you don't have to click on the update cart button anymore could that be a problem? seem I can setup my inventory ok, for example I have 7.50 and then when I login as a customer and try to buy say 1.25 ( 1 1/4 yard) to my cart it still only adds 1, any help or direction would be greatly appreciated

 

THANK YOU IN ADVANCE!

 

 

Kelly

Posted
I've tried to install this module several times making sure I did everything right and it still doesn work has anyone had any luck with this, My boss is up my butt to get this working, we sell fabric and now he wants to sell 1/4 yards and 1/2 yards, so people can order and add a half yard to their total I've tried attributes but you select the attribute before adding the quantity and that causes the attribute to added more that once, I also have the auto update cart mod so you don't have to click on the update cart button anymore could that be a problem? seem I can setup my inventory ok, for example I have 7.50 and then when I login as a customer and try to buy say 1.25 ( 1 1/4 yard) to my cart it still only adds 1, any help or direction would be greatly appreciated

 

THANK YOU IN ADVANCE!

 

 

Kelly

Hi Kelly,

 

Try this one i know its old http://addons.oscommerce.com/info/3779

but you do need to alter the fields on tables i believe im sure quantity is set to integer

 

Steve

Posted

I've tried that one and I guess it's too old cause in line 91 where it says to alter this line:

$this->update_quantity($products_id, (int)$qty, $attributes);

 

I don't have that line in my cart, although I do have this one:

 

$this->contents[$products_id_string] = array('qty' => (int)$quantity);

 

also you said they would have to be integer and the instructions say decimals,

 

I will try it and it see what happens, Thank You so much for your response I really appreciate you writing me and try to help me

 

Thanks,

 

Kelly

 

 

 

Hi Kelly,

 

Try this one i know its old http://addons.oscommerce.com/info/3779

but you do need to alter the fields on tables i believe im sure quantity is set to integer

 

Steve

Posted

I have all setup with that old contribution so when I try to buy 1.25 yards it still updates to just one yard , I have the auto update contribution can that be doing anything to it? I no longer have the update cart button, I'm just curious I would really love to get this to work

 

Thanks again for all your help I can begin to thank you all enough

 

Kelly

 

 

 

 

I've tried that one and I guess it's too old cause in line 91 where it says to alter this line:

$this->update_quantity($products_id, (int)$qty, $attributes);

 

I don't have that line in my cart, although I do have this one:

 

$this->contents[$products_id_string] = array('qty' => (int)$quantity);

 

also you said they would have to be integer and the instructions say decimals,

 

I will try it and it see what happens, Thank You so much for your response I really appreciate you writing me and try to help me

 

Thanks,

 

Kelly

Posted

Has anyone figured out how to install the contribution to make it work? Please can anyone help me!!

 

Thank You

 

Kelly

 

I have all setup with that old contribution so when I try to buy 1.25 yards it still updates to just one yard , I have the auto update contribution can that be doing anything to it? I no longer have the update cart button, I'm just curious I would really love to get this to work

 

Thanks again for all your help I can begin to thank you all enough

 

Kelly

  • 4 months later...
Posted

I have installed this contrib and it works only halfway.

 

Follow all instructions in the contrib 3779, but in addition do the following. This is a must do for all that want to sell products with yardage, like per meter or per yard. Order fractions or Decimal Quantity.

 

There is several places in /includes/classes/shopping_cart.php where you need to change quantity from Integer to decimal. In total there was 6 places in my installation.

 

Look in shopping_cart.php in the function add_cart, approx between row 78-133.

Look for (int)$qty and remove (int) from all of them

 

Look also in function update_quantity, approx row 135-170

Look for (int)$quantity and remove (int) from all of them

 

 

If you want the possibility for people to order quantities below 1, like 0.5 meter. there is 2 more changes you need to do.

 

In /includes/classes/shopping_cart.php:

approx row 178 there is a line that looks like this (in function cleanup):

if ($this->contents[$key]['qty'] < 1) {

chage it to:

if ($this->contents[$key]['qty'] < 0.1) {

Otherwise all products with quantity below 1 will be cleaned away!

 

 

In Checkout_shipping.php:

at row 23:

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

Change this to:

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 0.1) {

 

 

For all of you that also have problem with commas not working because of locale differences(Comma and point in quantity field (,.)). like some european countries (sweden, denmark and others)

You should do the following:

Make sure that only points (.) is sent to mysql by doing this:

 

open application_top from /catalog/includes/ and find all relevant

lines in the switch branch "update_product" and "add_product"

 

then change this:

$cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);

Into this:

$cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i] = str_replace(",", ".", $HTTP_POST_VARS['cart_quantity'][$i]), $attributes, false);

 

 

This took me hours to figure out, so I hope this will save them for you at least ;)

All the best

Rikard

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