Drupal Commerce Issue Queue

Prevent shopping cart form submission for completed orders

Mon, 01/19/2015 - 10:11

If you open the shopping cart form in multiple tabs and complete checkout in one of them, submitting the open shopping cart form from another tab will reset the order status of the completed order to "Checkout: Checkout." The shopping cart form does not have equivalent checks to the checkout router's that prevent access to checkout pages for an order after the order has progressed beyond a break point in the checkout process (loosely defined as a page with no back form button).

We should add an alteration to the shopping cart form that checks the order status during the form build process, since that's the earliest we can get to it, to prevent shopping cart form submission when the shopping cart order ID no longer matches a user's current cart order ID or when the order status indicates the order has progressed beyond a break point. To prevent submission of the shopping cart form in these cases, we'll use a redirect to whatever the current page is.

Categories: Issue Queues

How to Pay Others through commerce instead of receiving payments?

Mon, 01/19/2015 - 08:13

Hi,

I'd like to pay certain users.

Is it enough creating a line item type (product type) with negative (<0) price to keep consistency with Commerce?

I haven't done my homework yet (trying it) also I'd like to get some feedback / idea of others of this subject.

Thanks a lot!

Categories: Issue Queues

what&#039;s the available tokens in the &#039;Completion message&#039; checkout pane

Fri, 01/16/2015 - 23:48

I'm wondering what the available tokens in the 'Completion message' checkout pane are? I would like to generate a link to the purchased certificate and extracting the name of the purchaser as well as the purchased product. How can I do so?

Thank you,
Ron

Categories: Issue Queues

A video product for sell and purchase

Thu, 01/15/2015 - 22:34

I want to make a website that have videos as products. The products shown in views but after successful payment user can see the full video.

I am using video module for uploading videos
and using commerce module

Categories: Issue Queues

Product pricing rules fail with Rules 7.x-2.8 [use Rules 2.9]

Thu, 01/15/2015 - 07:30

OK, as of a day or two ago, one of my Commerce sites has started to apply no VAT to orders.

Symptoms:

  • VAT is applied correctly on Product display pages, and on the Basket page.
  • VAT is not applied at all on the Checkout Page, or after that in the checkout process.
  • If I add an empty coupon code to the order, the page refreshes and VAT is added correctly!

Stepping through the code with a debugger I just get hopelessly lost. I can't see the wood for the trees, there are so many function and method calls! I've learnt that you have to clear the cache too, otherwise the price field is simply loaded from cache, and not calculated from the base price plus taxes.

There aren't any errors reported in Drupal watchdog nor Apache logs.

Looking at the database, when I view the order's Basket, the line item commerce_unit_price_amount in the field_data_commerce_unit_price table includes VAT, and the commerce_unit_price_data includes all the VAT details.

But just going to the Checkout page causes the line item price to lose VAT, both in the price_amount and in the price_data.

Then refreshing the order by adding an empty discount coupon code adds in VAT to the display and to the line item data in the database.

Categories: Issue Queues

Update Price on Product Display Dynamically (AJAX?)

Wed, 01/14/2015 - 15:15

BACKGROUND:
I am using Commerce to create a site that sales banners, posters, signs, etc. The user of the site will enter the width, height and if the final piece will be 1 sided or 2. I have the width and height set as a line item type text field with the field type of decimal. I need the user to be able to enter whatever height and width they need as these times of products vary a lot in size and shape. Using a select field would need an infinite number of options as a banner could easily be 12.125" x 6.085".

To calculate the price for a product I am using Rules to take the WIDTH x HEIGHT to calculate square inches then taking that times 1 or 2 sided and the quantity. I have all that set up and when you hit the ADD TO CART button it does the math and looks good.

THE PROBLEM:
Now what I really need is to have the price on the Product Display change before the user hits ADD TO CART so that they know a cost before they put it in the cart. I have been trying to find ways to do this but not having much luck. Below are solutions I am thinking of but cannot find the answer to or a module that will help. Can anyone help point me in the correct direction?

1. Have the price update dynamically as the user changes the values (width, height, sides).

2. Have a CALCULATE COST button next to the add the cart (maybe using AJAX?) that the user can press after adjusting the width and height then if they are good with the price they can hit ADD TO CART. This option seems like it would be maybe the direction to go, but I do not have the expertise to know how to create such a button that does the Math using the RULE I set up.

3. Open to other ideas or suggestions...

Any help would be appreciated.

Categories: Issue Queues

commerce_customer_field_widget_form() must set #parents before calling field_attach_form()

Wed, 01/14/2015 - 10:44

Commerce calls field_attach_form() on a nested structure in only two places: commerce_cart_add_to_cart_form() and commerce_customer_field_widget_form().
Now, commerce_cart_add_to_cart_form() sets #parents as expected, but commerce_customer_field_widget_form() doesn't, which means that any commerce customer profile field widget (like the addressfield one) doesn't have accurate parents set, and is unable to access data in form state.

This breaks addressfield 7.x-1.0-rc1 on the order add/edit screen.

Categories: Issue Queues

Set an empty value for [&#039;exception&#039;][&#039;value&#039;] in the default User order history view.

Tue, 01/13/2015 - 04:43

Views adds all as a default exception value which creates a situation where this wildcard works in the default User order history view if the user has permission to view all orders or view all orders of type %type.

From views_handler_argument.inc:

<?php
  function is_exception($arg = NULL) {
    if (!isset($arg)) {
      $arg = isset($this->argument) ? $this->argument : NULL;
    }
    return !empty($this->options['exception']['value']) && $this->options['exception']['value'] === $arg;
  }
?>

Suggestion is just to tighten this up in commerce_order_ui.views_default.inc:

/* Contextual filter: Commerce Order: Uid */
...
$handler->display->display_options['arguments']['uid_1']['exception']['value'] = '';
...
Categories: Issue Queues

No line item validation when using &quot;update cart&quot; button

Fri, 01/09/2015 - 02:45

Hi,

I'm experiencing a validation issue when updating the line item on the cart page. If I set a product line quantity to -1 and hit update cart or continue button I see no validation errors and the fields are updated with the negative number but if I hit the remove button on the line item I see the validation errors and the field is not updated as expected.

Does anyone have any ideas why the validation is not working when using the update cart and continue button? Have tried using the default Drupal theme and disabling other modules but I am still experiencing the problem.

Cheers,
Tom

Categories: Issue Queues

&quot;Order balance&quot; doesn&#039;t match &quot;order total&quot; even if no payments made

Thu, 01/08/2015 - 21:59

I've been having an issue with a site where order totals aren't matching order balances in some orders (even if the order hasn't had any payments made on it yet, or if the payments are Purchase Orders, which don't affect the balance). At first I thought it was only ever $0.01 off, but now I see an order where the value is $0.15 off.

Regarding the $0.01 difference: I had a discussion (in IRC) with bojanz about this. He helped me figure out what is probably going on, which is that for the order total it seems the tax components are being rounded individually before being added to the total, whereas for the order balance they seem to be added together and then rounded up. Having two sales taxes applied leads to the extra penny if both are rounded up before being added together.

Anyhow, I wouldn't be surprised if I haven't given enough information here, but I'm just looking for a little guidance on where I might start looking. I am using commerce_discount with "%off Product discounts" and fixed discounts. I've attached a screenshot of one of the $0.01-discrepancy orders.

Thanks all!

Categories: Issue Queues

you have specified an invalid product for this reference field

Mon, 12/29/2014 - 08:26

When commerce product have missed reference to node, when saving node I see the message: you have specified an invalid product for this reference field because I use back referrence field (from node to commerce_product, that are in sync).

But when one node have many commerce_product entities linked, very hard to understand in which product there are problem.

Please add product SKU or product_id in this error message, for easily locating commerce product with problem.

Here is quick patch example - change:

<?php
          'message' => t('%name: you have specified an invalid product for this reference field.', array('%name' => $translated_instance['label'])),
?>

to:

<?php
          'message' => t("%name: you have specified an invalid product {$item['product_id']} for this reference field.", array('%name' => $translated_instance['label'])),
?>
Categories: Issue Queues