[Skip to main content](#vessel-content)

#   Discount vendor target

##

- **[tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")**
- [![tgdkere2's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8136-tgdkere2 "View tgdkere2's Profile") Topic Author
- [ Offline](/forum/user/8136-tgdkere2)

Less More

- Posts: 82
- Thank you received: 5
-
-

13 years 2 weeks ago -  13 years 2 weeks ago [\#130917](#130917) by [tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")  *[Discount vendor target](/forum/19-hikamarket/863364-discount-vendor-target#130917 "Hi, I used the modified code from AWO Coupon to add a dscount coupon also t the vendor. Since the last upgrade of HikaMarket, it does not work anymore.  The discount is applied to the vendor, BUT the vendor order (invoice) ist still displayed without the discount.  I used the following code:  Any tips, why it does not work anymore ? Thanks and br")* was created by *[tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")*

Hi,
I used the modified code from AWO Coupon to add a dscount coupon also t the vendor.
Since the last upgrade of HikaMarket, it does not work anymore.

The discount is applied to the vendor, BUT the vendor order (invoice) ist still displayed without the discount.

I used the following code: Code:

if(class_exists('hikamarket')) { $object-&gt;discount_target_vendor = 1; $hikamarket_config = hikamarket::config(); $totaldiscount_str = $hikamarket_config-&gt;get('calculate_vendor_price_with_tax',false) ? 'totaldiscount' : 'totaldiscount_notax'; $object-&gt;products = array(); foreach($cart-&gt;products as $product) { foreach($coupon_session['cart_items'] as $item) { if($product-&gt;product_id == $item['product_id']) { if(isset($product-&gt;variants)) { foreach($product-&gt;variants as $variant) { $tmp_product = clone($variant); $tmp_product-&gt;processed_discount_value =round($item[$totaldiscount_str],2); $object-&gt;products[] = $tmp_product; } } else { $tmp_product = clone($product); $tmp_product-&gt;processed_discount_value =round($item[$totaldiscount_str],2); $object-&gt;products[] = $tmp_product; } break; } } } }

Any tips, why it does not work anymore ?
Thanks and br

Last edit: 13 years 2 weeks ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: [code] is nice

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODYzMzY0LWRpc2NvdW50LXZlbmRvci10YXJnZXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

13 years 2 weeks ago [\#130927](#130927) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Discount vendor target](/forum/19-hikamarket/863364-discount-vendor-target#130927 "Hi, I used the modified code from AWO Coupon to add a dscount coupon also t the vendor. Since the last upgrade of HikaMarket, it does not work anymore.  The discount is applied to the vendor, BUT the vendor order (invoice) ist still displayed without the discount.  I used the following code:  Any tips, why it does not work anymore ? Thanks and br")*

Hi,

The variable "proccessed_discount_value" is used by HikaMarket during his vendor total processing but I don't know what/where the discount should be displayed in the invoice.
HikaMarket and HikaShop displayed the total discount when there is a coupon code in the order.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE5LWhpa2FtYXJrZXQvODYzMzY0LWRpc2NvdW50LXZlbmRvci10YXJnZXQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.047 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
