Post by IT_MAN » Tue Oct 01, 2013 11:09 am

Hi to all. It's been a while since I last posted here in the forums. I have been using, modifying and customizing several OC based cart sites, I just have this one inquiry regarding the shipping method part in checkout. I want to filter something in that part using the product_id of the items in the cart, but I can't even make it appear in the page. Can someone help me? Thanks in advance!

New member

Posts

Joined
Tue Apr 23, 2013 11:18 am

Post by Qphoria » Tue Oct 01, 2013 10:01 pm

You'll have to edit the catalog/model/shipping/xxx.php file

to get the individual product ids you'll use:

Code: Select all

foreach ($this->cart->getProducts() as $product) {
    if ($product['product_id'] == 24)) {
        // do something
    }
}

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by IT_MAN » Tue Oct 08, 2013 1:43 pm

Qphoria wrote:You'll have to edit the catalog/model/shipping/xxx.php file

to get the individual product ids you'll use:

Code: Select all

foreach ($this->cart->getProducts() as $product) {
    if ($product['product_id'] == 24)) {
        // do something
    }
}

Thank You very much!! I will try this now!!

New member

Posts

Joined
Tue Apr 23, 2013 11:18 am

Post by IT_MAN » Tue Oct 08, 2013 2:21 pm

Is it possible to filter the shipping method by the product_id in the checkout part? Like when they order product no 1, with product_id of 1, I will show this shipping method A. That's the main scenario I want to happen. Is there a way how to make it happen? Thanks in advance!

New member

Posts

Joined
Tue Apr 23, 2013 11:18 am

Post by Johnathan » Tue Oct 08, 2013 10:37 pm

Not sure if you're interested in a commercial extension, but Restrict Shipping Methods can do what you want.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 13 guests