Note that there are some explanatory texts on larger screens.

plurals
  1. PODrupal commerce discount on custom checkout form
    primarykey
    data
    text
    <p>i am trying to add discount to my custom checkout form I have used commerce discount it is working fine on my local drupal 7 with commerce installation. so i have tried on the cab site,but on the live site is not adding the discount amount. So i have added the test action on the discount rule to show the message on the site "discount added".<br> what more confussing is the message is displaying which means the rule is working but the discount is not adding find the below code i have used to add product to cart </p> <pre><code> function xxx_commerce_cart_product_add($order, $product, $quantity, $line_item) { if ($product-&gt;type == 'xxx') { $order_wrapper = entity_metadata_wrapper('commerce_order', $order); foreach ($order_wrapper-&gt;commerce_line_items as $delta =&gt; $line_item_wrapper) { if ($line_item_wrapper-&gt;commerce_product-&gt;product_id-&gt;value() == $product-&gt;product_id) { $miles = $_SESSION['booking']['miles']; $title = $line_item_wrapper-&gt;line_item_label-&gt;value(); $line_item_wrapper-&gt;line_item_label-&gt;set($title); $line_item_wrapper-&gt;quantity-&gt;set($miles); $line_item_wrapper-&gt;save(); } else { // only one cab can be booked in an order, so remove any other cab added previously. commerce_cart_order_product_line_item_delete($order, $line_item_wrapper-&gt;line_item_id-&gt;value()); } } $checkout_panes = &amp;drupal_static('commerce_checkout_panes'); unset($checkout_panes); } if(arg(0) == 'system') { // on homepage, we have action url to system/ajax for add to cart form. // so to avoid viewing a non-viewable path, we are redirecting it here. drupal_goto('checkout'); } elseif(arg(0) =='checkout'){ drupal_goto($_SERVER['REQUEST_URI']); } }` </code></pre> <p>how to solve the above issue </p> <p>Is there some thing i am missing</p> <p>Please point me in right direction</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload