Post by RNRF » Tue Apr 17, 2012 7:29 pm

Hi all

I'm using OpenCart v1.5.2.1 and got the site for my business nearly complete.
Just wanted to help me in a situation please.
In Step 5 of checkout "Payment method" have three options: paypal / bank transfer / cash-delivery . I would for a category of products that I have, restrict the method cash-delivery, but only for that particular product / category .
The order can have several products, but if it only have one product of that category that no longer will send at cash-delivery.
I certainly need some code to create a function in the checkout when a product appears in checkout , its impossible to pay at cash-delivery.
I hope you can help me , this is a bit urgent for me =\

Thank you
RNRF

Newbie

Posts

Joined
Mon Apr 16, 2012 12:34 am

Post by Johnathan » Tue Apr 17, 2012 9:24 pm

It sounds like Restrict Payment Methods would work for you.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by RNRF » Wed Apr 18, 2012 7:07 am

Price: $35 $30

This is not what im whaiting dude

Newbie

Posts

Joined
Mon Apr 16, 2012 12:34 am

Post by JAY6390 » Wed Apr 18, 2012 7:37 am

In that case, you will be hard pushed to find a solution to your problem

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by RNRF » Wed Apr 18, 2012 8:02 pm

What i want its very easy to any programmer , i prefer to pay 10$ for 30min of work

Newbie

Posts

Joined
Mon Apr 16, 2012 12:34 am

Post by JAY6390 » Wed Apr 18, 2012 8:06 pm

Right, but most good programmers don't charge $10 for 30 mins work. You wouldn't get 10 minutes of work from me for that lol. If it's very easy, you should have no problem getting a programmer from a third world country to do this for you for your budget. I can tell you now that Jonathan's put far more than 30 minutes into the module above

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by Johnathan » Wed Apr 18, 2012 9:03 pm

RNRF wrote:Price: $35 $30

This is not what im whaiting dude
The prices of all my extensions reflect the amount of time it takes to create and support them, and I believe they offer a fair value for what they cost. That being said, I understand they are not within everyone's web design budget, so no hard feelings if you are looking for a cheaper solution.

Hope you find something that works for you!

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by RNRF » Thu Apr 26, 2012 9:00 pm

One of my friends tell one code function to 1.5.1.x version to edit on /catalog/controller/checkout/payment.php
but in my version ( 1.5.2.1 ) This fille does not existe .

Code: Select all

if ($this->request->server['REQUEST_METHOD'] == 'POST') {

next add

Code: Select all

$products = $this->cart->getProducts();
        $this->load->model('catalog/product');
        $hasTargetCat = false;
        foreach ($products as $product) {
            $temp_product_id = $product['product_id'];

            $temp_categories = $this->model_catalog_product->getCategories($temp_product_id);
            foreach($temp_categories as $temp_category) {
                if($temp_category['category_id']==18)$hasTargetCat=true;
            }
        }
18 is category_ids.

next find :

Code: Select all

 if (isset($this->session->data['payment_methods'])) {
                $this->data['payment_methods'] = $this->session->data['payment_methods'];
            } else {
                $this->data['payment_methods'] = array();
            }
and add next :

Code: Select all

 if($hasTargetCat) {
                foreach($this->data['payment_methods'] as $kpm=>$vmp) {
                    if($vmp['code']=='cod')unset ($this->data['payment_methods'][$kpm]);
                }
            }

Newbie

Posts

Joined
Mon Apr 16, 2012 12:34 am
Who is online

Users browsing this forum: No registered users and 90 guests