How to apply Order user price level at backend?

  • Posts: 64
  • Thank you received: 0
11 years 4 weeks ago #164631

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.0

I was thinking that at the backend product price applies as per the order user group but it looks it is not true.It also not depend on the user who is editing that order.Could you please help me how to solve this?

I have made some changes but not sure if this would affect something else.

I have made below changes in admin/com_hikashop/views/order/view.html.php inside function edit_products

//commented by Irfan
					//$currencyClass->getPrices($rows, $product_id, $currency_id, $main_currency, $zone_id, $discount_before_tax);					
					//added by Irfan,note:order user group price in hikashop
					//product_add:order controller
					if(!empty($product_id)){
						JArrayHelper::toInteger($product_ids);
						$database	= JFactory::getDBO();
						$query = 'SELECT * FROM '.hikashop_table('product').' WHERE product_id IN ('.$product_id[0].')';
						$database->setQuery($query);
						$rows = $database->loadObjectList();
					}
					$currencyClass->getPrices($rows, $product_id, $currency_id, $main_currency, $zone_id, $discount_before_tax,$order->order_user_id);
					//End by Irfan

Thanks,
Irfan

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

  • Posts: 84219
  • Thank you received: 13671
  • MODERATOR
11 years 4 weeks ago #164699

Hi,

Filling the user_id is indeed a good idea. However I don't see the point of the other code to set the $rows variable since it's already set with the product data like this:

$rows = array($product);
					if($isVariant){
						$rows[]=$allproducts[ (int)$product_id[1] ];
					}
Do you have a case where this doesn't work ?

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

  • Posts: 64
  • Thank you received: 0
11 years 4 weeks ago #164704

Actually the case where I had the issue, when there is no price(free) for order user.It selects one of the price(I am not sure what is the algorithm it uses) and it reduces the same price in VAT even vat is not applied to that product.For example-For user A no price is applicable that is zero(or free).So when we add it through backend it sets price 25(this is the first price in the price list) and Vat -25.So the price will be zero but calculation is odd.In the system vat is set to 5% for canada and this order is for Russia.

I hope I make my point clear.Any suggestion for this case?

Thanks,

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

  • Posts: 13201
  • Thank you received: 2322
10 years 11 months ago #171952

Hi,

Do you have solved your issue about this ?

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

  • Posts: 64
  • Thank you received: 0
10 years 10 months ago #172034

Yes,I have used the same code as I posted above.And so far it is working fine.


Regards,

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

Time to create page: 0.077 seconds
Powered by Kunena Forum