Problem/Motivation

When attributes are enabled, the add to cart form will refresh when an attribute is selected
that alters price, and reflects the updated price. I'd like to add functionality to have this
process also check the quantity field against the price tablet to show the corresponding price
when the form is rebuilt.

Proposed resolution

I've managed to get the form to refresh on quantity change, but
$line_item_wrapper->quantity->value() in commerce_price_table_groups_set_price is "1" regardless of what the quantity input is set to. Anyone have any pointers of where to look for that fix? Thanks

CommentFileSizeAuthor
#9 ajax-price.jpg12.25 KBmrpauldriver

Comments

bobmurdoch’s picture

Apologies for the double post.

urlaub’s picture

I have a case where default quantity is "2", the default price should be for to "2" as well, but the add to cart form shows price for "1" regardless of what the quantity input is set to?

pcambra’s picture

Status: Active » Postponed (maintainer needs more info)

Seem like you both share the same request, but I don't quite understand what's exactly it as this module just displays a price table so it displays the whole range of prices by quantity.

If I've understood correctly, you'd want to see what the price is going to be depending on the quantity that the user inputs?

I could really use a graphical representation of what you're wanting here.

pcambra’s picture

Maybe this helps you #1330544: Pass quantity to the 'set price' rules action now quantity comes from the rule so you can alter it before prices are calculated.

urlaub’s picture

pcambra thanks for your response!

I would like to have a quantity drop-down-list (limited to 6, default value 2), to alter the quantity value.
Changing quantity in the quantity drop-down-list, should refresh the price immediately (ajax).

mrpauldriver’s picture

Yes please, same request as #5

pcambra’s picture

As I say in #3

I could really use a graphical representation of what you're wanting here.

Seriously, I don't see how this issue can be related with the price table.

mrpauldriver’s picture

Hello pcambra and thank you for keeping an eye on comments.

I think we're just asking for an alternative UI for displaying prices to a buyer rather than a price table. One way of doing that is with an ajax refresh of the price, where the quantity input is replaced with a drop down list or something similar

Whilst this isn't directly related to the display of the price table, the underlying price data is entered into a price table and that is where your module is really useful and where the relationship does exist.

Commerce Extra module provides a suitable widget for changing quantity (see next post), what is missing is a Ajax style price refresh based on quantity change or more relevantly, price table data.

Thank you again for your interest.

---
Edited a few minutes after first posting because of Commerce Extra discovery

mrpauldriver’s picture

StatusFileSize
new12.25 KB

Graphic of Commerce Extra quantity widget attached

pcambra’s picture

Project: Commerce Price Table » Commerce Extra
Version: 7.x-1.0 » 7.x-1.x-dev
Component: Code » General
Status: Postponed (maintainer needs more info) » Active

Ok, so it's probably better to send this issue to commerce extra itself, as the main thing asked for here is the ajax refresh of the price when changing quantity

mrpauldriver’s picture

Status: Active » Closed (works as designed)

Okay, I'll put in a feature request with Commerce extra. Thank you

mrpauldriver’s picture

Status: Closed (works as designed) » Active
imiksu’s picture

Status: Active » Closed (duplicate)

Closing this up, since Paul has put a separate feature request which describes the problem more clearly: #1432588: Compatibility with Commerce Cart Ajax module

mrpauldriver’s picture

To clarify that's two issues.

There is one compatibility issue, being #1432588: Compatibility with Commerce Cart Ajax module as mentioned in the previous post.

And one feature request being the one set out in this issue: for an Ajax refresh of the display node price when quantity is changed with the Commerce Extra quantity widget.

mrpauldriver’s picture

Status: Closed (duplicate) » Needs review

I wondered whether the second point in my last post had been mixed up with #1432588. Are these two related?

The feature request is for an AJAX style price refresh based on a quantity change with the quantity widget in the display node - not the cart?

Please correct me if wrong.