Sorry for the really bad title but wasn't sure how to describe my problem in 10 words. I have drupal commerce and have made a view that displays the cart contents on top of the checkout page. Quantity is a text field so it is editable and I have an update button. Unfortunately when I press the update button, naturally the whole checkout page tries to submit. Is there a way to intercept the update button and just refresh the cart with ajax? Moreover, if I can do that, I want a number of text fields (as many as the quantity number entered) to appear underneath the cart so the user can enter different values on each of them (each referring to the products about to be bought).
问问题
2630 次
2 回答
1
Drupal Commerce Cart 就是这样做的——有点像.. http://drupal.org/project/dc_cart_ajax
它在购物车页面上运行良好,尽管我也试图合并这些页面以减少“结帐步骤”。尽管它与 /cart 页面的视图相同,并且我得到了一个 ajax 刷新指示器,但它实际上并没有更新结帐页面上的购物车。
有一个相关的问题,你可以订阅:http ://drupal.org/node/1443470
于 2012-02-13T23:27:49.407 回答
0
您可以使用结帐设置禁用购物车内容。修改购物车视图以添加块显示并添加通过使用 PHP 提供默认值来修改上下文过滤器:
if (arg(0) == 'checkout') return arg(1);
else return null;
仅在结帐页面上添加新的购物车块显示,然后就可以了。
于 2012-03-31T02:54:31.227 回答