Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Total weight in subselect sales rule #16

Open
etsanov opened this issue Oct 20, 2017 · 0 comments
Open

Total weight in subselect sales rule #16

etsanov opened this issue Oct 20, 2017 · 0 comments

Comments

@etsanov
Copy link

etsanov commented Oct 20, 2017

Hi,

I installed your extension (nicely done by the way).

Additionally, in ./app/code/local/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php, I changed:

            'qty'  => Mage::helper('salesrule')->__('total quantity'),
            'base_row_total'  => Mage::helper('salesrule')->__('total amount'),

to

            'qty'  => Mage::helper('salesrule')->__('total quantity'),
            'base_row_total'  => Mage::helper('salesrule')->__('total amount'),
            'weight'  => Mage::helper('salesrule')->__('total weight'),

I did that, because I needed to apply a rule that will add extra fee based on the total weight of items per supplier in the cart. It actually works fine for single products (quantity "1" in cart), but if I increase the quantity of an item in the cart, the total weight per supplier seems not to increase as expected, and the extra fee stays the same.

For example, I set up a rule to add extra fee of "10" if total weight is greater than 4 for a subselection of items in cart matching ALL of these conditions: supplier is "X". I have 2 different items in the cart, each "2.5 kg". Each item has "X" as supplier. The extra fee of "10" is added in cart/checkout. If I remove one of the items, the extra fee is removed (total weight for items with supplier "X" is now "2.5 kg").

However, if I remove one of the items, but I increase the quantity of the one item left, I would expect the total weight to become "5", and the extra fee should appear. However, that does not happen. Even if I increase the quantity for that item to "10", the weight remains "2.5 kg", and the extra fee never appears.

I am sorry for the long description of the problem. I am not sure if the problem is with your extension or with the way I added "weight" to Subselect.php. I would be happy to hear a suggestion on the issue, though.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant