Have a promo code only on one product

Permalink Browser Info Environment
Hi everybody !

I need your help ! My client have a special request for hist eCommerce with gift card. He want to make a promotion next week but for only one product. The problem with the giftCard add-on is that when you make a promotion on one product, if you have other products in the order, the promotion is on the whole order and I want it only on the product chosen in the dashboard. Have anyone ever tried this and have a solution ?

I'm going to search but I'll be very happy if you can help me !

Thank you !

Type: Discussion
Status: New
Rmg
View Replies:
Rmg replied on at Permalink Reply
Rmg
Okay, I found a way to do this !

During my search, a found that we can make this with the select button on the dashboard of the giftCard plug, but, that didn't work too.

So I made some code on queue.php to make that work like I said in the preview post. So the promotion is only on the file chosen, and it is writen on the attribute name what product has a reduction.

You can alsaw make a javascript and css function for adding a banner, or color, or something on the promoted product.

I hope this code can be helpfull for someone !

First add this after the definition of $valueLeft

/*
       *SET THE DISCOUNT ON THE PRODUCT TOTAL INSTEAD OF THE AMOUNT TOTAL
       */
      $prID = array();
      $db = Loader::db();
      $sql = "SELECT productID FROM CoreCommerceGiftCardsCouponSetProducts WHERE couponSetID=".$coupon->getCouponSetID()."";
      $result = mysql_query($sql);
      while($list = mysql_fetch_row($result)){      
         foreach($list as $array => $z){
            array_push($prID, $z);
         }
      }
      if(sizeof($prID)>0){
         $orderCanBePaid = 0;
         //Check the name of the product in the order

Then add this to the setAttribute function to show the name of the product in the name of the attribute.
/*********** If it is a coupon for a specific product, find the name of the product and the reduction.************/
      $couponName = ' : '.$out.' '.$valueOfCoupon;
      // Update the gift card payment attribute on the order
      $this->order->setAttribute('discount_gift_card_adjustment', array('label' => t("Gift Card Payment").$couponName, 'type' => '-', 'value' => $paidWithCoupons));
Mainio replied on at Permalink Reply
Mainio
Hi,

And great to hear you found a solution to your problem. Sorry for not answering you before, this had slipped off my task list.

Is it possible for you to remove the code part from the post above as it contains our copyrighted code under our license? If you want to show how you did that, you could simply post the modified parts.

Best,
Antti / Mainio
Rmg replied on at Permalink Reply
Rmg
Hi,

no problem, I removed it.

Best

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.