Discount vendor target

  • Posts: 78
  • Thank you received: 4
  • Hikamarket Multivendor Hikashop Business
11 years 2 weeks ago #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:

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;
					}
				}
			}
		}
Any tips, why it does not work anymore ?
Thanks and br

Last edit: 11 years 2 weeks ago by Jerome. Reason: [code] is nice

Please Log in or Create an account to join the conversation.

  • Posts: 26156
  • Thank you received: 4028
  • MODERATOR
11 years 2 weeks ago #130927

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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.055 seconds
Powered by Kunena Forum