Restricted shipping method on all products

  • graveltravel
  • Topic Author
10 years 2 months ago #172669

-- url of the page with the problem -- : shop.graveltravel.nl

Hello,

I'm using a multi-vendor version and the manual shipping method plugin. For each vendor/warehouse/weight/region combination I have added shipping methods. So far, so good, everything works fine.

For 1 vendor/warehouse combination I added a shipping method that I want see on all products of this vendor. As you can see below the shipping method is displayed on all products, restricted to vendor Maxado, warehouse Alutec and region Benelux. But now it seems that the shipping method is displayed on all products, and not only the products from Maxado/Alutec. In the cart however it works fine. The right shipping methods are listed.

But restricting the shipping method to a vendor and warehouse seems not to work in the backend of Hikashop and the
restriction is not taken into account.

It seems a bug to me. Please advise?

Thanks, Eric

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
10 years 2 months ago #172678

Hello,

For 1 vendor/warehouse combination I added a shipping method that I want see on all products of this vendor. As you can see below the shipping method is displayed on all products, restricted to vendor Maxado, warehouse Alutec and region Benelux. But now it seems that the shipping method is displayed on all products, and not only the products from Maxado/Alutec. In the cart however it works fine. The right shipping methods are listed.

If you want to restrict a product to only some product you'll have 2 solutions :
1.
You can use 1 warehouse per vendor, and then assign that warehouse to your shipping method and to your products.
2.
- You can use the "Use price per product" option
- Go to your products configuration page and use the "Blocked" checkbox through the "Shipping prices" tab for the shipping method that you don't want to be used for your products.

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

  • graveltravel
  • Topic Author
10 years 2 months ago #172727

Hi Mohammed,

Thanks for your quick reply.

I have done exactly what you describe under pt. 1. I have 10 vendors, each with his own warehouse. And each product is assigned a vendor and warehouse. For each vendor I've added one or more shipping methods with restrictions set to vendor, warehouse, region and weight. Works all perfect. Uhh, but NOT for Shipping Methods that have 'Use Price per Product'. These Shipping Methods appear on each product independent of the Vendor and Warehouse.

Below you'll see 2 shipping methods belonging to Maxado/Alutec viewed on a Product from KSTools/KSTools. That is not correct. I hope you agree?

Kind regards, Eric




Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
10 years 2 months ago #172881

Hello,
We just made a fix regarding that issue, you'll just have to edit the "plugins\hikashop\shippingmanual_prices\shippingmanual_prices.php" file and after these lines :

$query = 'SELECT b.*, a.*, c.currency_symbol FROM ' . hikashop_table('shipping') . ' AS a LEFT JOIN '.
hikashop_table('shipping_price').' AS b ON a.shipping_id = b.shipping_id AND b.shipping_price_ref_id = '.$product_id.' INNER JOIN '.
hikashop_table('currency').' AS c ON c.currency_id = a.shipping_currency_id '.
'WHERE a.shipping_params LIKE '.
$db->Quote('%s:20:"shipping_per_product";s:1:"1"%') . ' AND (b.shipping_price_ref_id IS NULL OR (b.shipping_price_ref_id = ' . $product_id . ' AND b.shipping_price_ref_type = \'product\')) '.
'ORDER BY a.shipping_id, b.shipping_price_min_quantity';
$db->setQuery($query);
$shippings = $db->loadObjectList();
Add these lines :
$temp_shipping = new stdClass();
foreach($shippings as $key => $shipping){
	$temp_shipping = unserialize($shipping->shipping_params);
	// To avoid shipping_warehouse_filter = "shipping_warehouse_filter" V "shipping_vendor_filter"
	if(!empty($temp_shipping->shipping_vendor_filter) && !empty($temp_shipping->shipping_warehouse_filter)){
		$temp_shipping->shipping_warehouse_filter = substr($temp_shipping->shipping_warehouse_filter, 0, 1);
	}
	if(!empty($product->product_warehouse_id) && $product->product_warehouse_id != 0){
		if(!empty($temp_shipping->shipping_warehouse_filter) && ($temp_shipping->shipping_warehouse_filter != $product->product_warehouse_id) && ($temp_shipping->shipping_warehouse_filter != 0)){
			unset($shippings[$key]);
		}
	}
	else{
		if(!empty($temp_shipping->shipping_warehouse_filter) && ($temp_shipping->shipping_warehouse_filter != 0)){
			unset($shippings[$key]);
		}
	}
	if(!empty($product->product_vendor_id) && $product->product_vendor_id != 0){
		if(!empty($temp_shipping->shipping_vendor_filter) && ($temp_shipping->shipping_vendor_filter != $product->product_vendor_id) && ($temp_shipping->shipping_vendor_filter != 0)){
			unset($shippings[$key]);
		}
	}
	else{
		if(!empty($temp_shipping->shipping_vendor_filter) && ($temp_shipping->shipping_vendor_filter != 0)){
			unset($shippings[$key]);
		}
	}
}

Last edit: 10 years 2 months ago by Mohamed Thelji.
The following user(s) said Thank You: graveltravel

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

  • graveltravel
  • Topic Author
10 years 2 months ago #172885

Hi Mohammed.

Great, thanks! I'll do the update tomorrow and let you know the result.

Kind regards, Eric

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

  • graveltravel
  • Topic Author
10 years 2 months ago #173041

Hi Mohammed,

I just receive a message that Multi Vendor 1.4.4 and Business 2.3.3 is available for installation. Is the bugfix included in these new versions, or do I have to make the modifications after installation the updates?

Thanks, Eric

Last edit: 10 years 2 months ago by graveltravel.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 1 month ago #173047

Hello Eric,
No the bug fix won't be included on that version, so you'll have to add this modification manually after the installation of the updates.

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

Time to create page: 0.095 seconds
Powered by Kunena Forum