- Posts: 82
- Thank you received: 5
Discount vendor target
12 years 11 months ago - 12 years 11 months ago #130917
by tgdkere2
Discount vendor target was created by tgdkere2
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
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->discount_target_vendor = 1;
$hikamarket_config = hikamarket::config();
$totaldiscount_str = $hikamarket_config->get('calculate_vendor_price_with_tax',false) ? 'totaldiscount' : 'totaldiscount_notax';
$object->products = array();
foreach($cart->products as $product) {
foreach($coupon_session['cart_items'] as $item) {
if($product->product_id == $item['product_id']) {
if(isset($product->variants)) {
foreach($product->variants as $variant) {
$tmp_product = clone($variant);
$tmp_product->processed_discount_value =round($item[$totaldiscount_str],2);
$object->products[] = $tmp_product;
}
}
else {
$tmp_product = clone($product);
$tmp_product->processed_discount_value =round($item[$totaldiscount_str],2);
$object->products[] = $tmp_product;
}
break;
}
}
}
}
Thanks and br
Last edit: 12 years 11 months ago by Jerome. Reason: [code] is nice
Please Log in or Create an account to join the conversation.
12 years 11 months ago #130927
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Discount vendor target
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,
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 & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.267 seconds