Jump to content

Product And Carrier Restrictions


Recommended Posts

Hi everyone,

 

I've seen this issue elsewhere in the forums but want to raise it so the Prestashop developers get to fixing it!

 

Issue as follows:

 

1. Some products e.g. Battery and Power banks can only ship with Carrier B.

2. Other products e.g. Phones can ship with Carrier A

 

the problem...

 

If Products with Carrier A and B are in the Cart it still allows those products to be ordered. What I need to happen is if a Product using Carrier A is mixed with Carrier B one of the products should be restricted or a message to state that there is a product which is in the basket that is unable to ship.

 

Product 1 has been set to only use Carrier A

Product 2 has been set to only use Carrier B

 

So when Product 1 and 2 are in basket WHY does it still allow shipment? What's the point of selecting a specific carrier for a product if it doesnt work!?

 

Any help please? I am going crazy!

Link to comment
Share on other sites

Hi

 

Did you go to the end of the order process? Normally the order should be split into two packages, one per carrier, and a "double shipment" option should be proposed. Except if one of the carriers is not available for the shipping destination...

 

Regards

 

Hi there erouvier29,

 

It just presented a single $24.00 shipping with no Carrier name next to the price for shipping so no, it wasn't split into two orders. No double shipping was presented either.

 

As I say one product can ship with DHL, the other only with NL Post.

 

In the case of having both products in the basket there is no options to split ship or anything like that. I'd be interested to know how to achieve what you've proposed. If it matters we are using the Localized shipping module fromn Presto-Changeo as well.

 

Cheers,

 

Mark

Link to comment
Share on other sites

Hi again Mark,

 

In order to observe what I decribed on a fresh 1.6.X installation you normally have nothing else to do than defining the 2 carriers and configuring the products wrt shipping.

Then, when the cart contains only products 1 & 2 as above, the only proposed shipping option will be "A (for 1) and B (for 2)"

 

In your case isn't $24 the sum of the 2 shipping costs for A and B?

 

In order to be sure, I just tried on PS 1.6.1.4 and I get actually a template error at the place the shipping option should be (It works on PS 1.6.0.14).

If your site is not in DEV mode, then it is possible that you get a blank area instead. Can you switch to DEV mode and check?

On my side, I will be able to investigate on this template (order-carrier.tpl) later on...

 

Cheers

--

Eric

Edited by erouvier29 (see edit history)
  • Like 1
Link to comment
Share on other sites

Hi again Mark,

 

In order to observe what I decribed on a fresh 1.6.X installation you normally have nothing else to do than defining the 2 carriers and configuring the products wrt shipping.

Then, when the cart contains only products 1 & 2 as above, the only proposed shipping option will be "A (for 1) and B (for 2)"

 

In your case isn't $24 the sum of the 2 shipping costs for A and B?

 

In order to be sure, I just tried on PS 1.6.1.4 and I get actually a template error at the place the shipping option should be (It works on PS 1.6.0.14).

If your site is not in DEV mode, then it is possible that you get a blank area instead. Can you switch to DEV mode and check?

On my side, I will be able to investigate on this template (order-carrier.tpl) later on...

 

Cheers

--

Eric

 

Hi Eric,

 

Thanks for taking the time to comment on this for me. I dont see any carriers name but do see the cost at 24.00... I am going to check what you said to see if it shows the options at the end of the full order process e.g. completed processed order.

 

Edit: You are correct, the $24.00 is the sum total of DHL and NL Post rates for the selected products weight range and cost. However, what would be good is if it showed the couriers which the items will ship with so the customer is aware of the selections. Is that possible?

 

Best regards,

 

Mark

Edited by dysfunction (see edit history)
Link to comment
Share on other sites

Found a bug in /themes/defaut-bootstrap/order_carrier.tpl

 

Before understanding what this code is actually for, I suggest you comment out or remove the blocks

{if $first.product_list[0].carrier_list[0] eq 0} hide{/if}

and

{if $carrier.product_list[0].carrier_list[0] eq 0} hide{/if}

appearing twice each (lines  131, 138, 203, 210), as in the attached file

 

order-carrier.tlp.zip

 

  • Like 2
Link to comment
Share on other sites

Found a bug in /themes/defaut-bootstrap/order_carrier.tpl

 

Before understanding what this code is actually for, I suggest you comment out or remove the blocks

{if $first.product_list[0].carrier_list[0] eq 0} hide{/if}

and

{if $carrier.product_list[0].carrier_list[0] eq 0} hide{/if}

appearing twice each (lines  131, 138, 203, 210), as in the attached file

 

attachicon.giforder-carrier.tlp.zip

 

Thanks Eric, if it matters I am using Leo Universe Theme not the default bootstrap one... Would this still be applicable?

 

Obviously keen to find a way to show the carriers which will be used to ship the product lines as well if that's at all possible.

 

Best regards,

 

Mark

Link to comment
Share on other sites

I've solved the issue of it showing the Carrier name, however it only shows one of the Carriers in the list, not both of them. In this case it shows NL Post but not DHL even though both products in the basket are corresponding to those carriers respectively.

 

EDIT: This is now resolved :-)

 

Thanks once again, Eric. Your feedback as proved very helpful to assisting my progression with this project.

 

Best regards,

 

Mark

Edited by dysfunction (see edit history)
Link to comment
Share on other sites

  • 1 year later...

I have a similar issue as this one so I would like to continue on this subject rather than starting a new topic.

 

I have some products that I ship internationally while I have others that I don't due to weight and size. For those products, I have it selected in the product under "Shipping" only my U.S. shipping carriers.

 

The problem I have is that if a customer say in Europe is ordering a product that I ship internationally and a product that I don't, it still allows them to place the order and then it will split the order in to 2 orders. For the split order with the item that doesn't ship internationally, it doesn't give the order a carrier (so no charge for shipping) but then it still charges the customer for the product.

 

If a customer has a product in their cart that doesn't ship internationally, no matter what else they have in their cart, how can I make it so that they can't place the order (no carriers will be listed)?

 

Please help! Thanks!

Link to comment
Share on other sites

Yes, curiously there is a condition that makes carrier unvailable only in case of a unique package.

You can change that behavior within Cart.php.

 

Find the following lines (starting 2095 in the latest 1.6.1.X versions):

            // Foreach packages, get the carriers with best price, best position and best grade
            foreach ($packages as $id_package => $package) {
                // No carriers available
                if (count($packages) == 1 && count($package['carrier_list']) == 1 && current($package['carrier_list']) == 0) {
                    $cache[$this->id] = array();
                    return $cache[$this->id];
                }

And remove or comment out the "1 package condition":

            // Foreach packages, get the carriers with best price, best position and best grade
            foreach ($packages as $id_package => $package) {
                // No carriers available
                if (/*count($packages) == 1 &&*/ count($package['carrier_list']) == 1 && current($package['carrier_list']) == 0) {
                    $cache[$this->id] = array();
                    return $cache[$this->id];
                }

Next step is to explain clearly to the customer why the order cannot be placed...

  • Like 3
Link to comment
Share on other sites

  • 6 months later...

Thank you so much!

I have been trying to solve this problem for days - looking at carrier selection etc

This fixed it

(Exactly the same problem - we ship some items to EU only and some worldwide - if someone selected an item that was EU only along with worldwide it would allow checkout - this fixed it)

Very happy

Link to comment
Share on other sites

  • 8 months later...

I have a very similar problem, so maybe it is best to ask here.


I have two kind of items with different delivery options.


When items without a common delivery options are in the shopping cart together this is shown:

image.thumb.png.ad0cea366d484103904c7e2a0566004a.png

 

Then when de order is processed two different orders are generated for the two different delivery options.

 

I want to stop the customer at this point and for them to review their cart, They should not choose items from these two delivery options at the same time because one is a kind of "pre-order" and the other is normal products to buy right now.

 

I think that in this thread the issues are similar and those files that erouvier29 has modified must be where I have to modify as well.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...