Jump to content

Help with OrderDetailController.php (presta 1.6.1)


Jeff Dee

Recommended Posts

Hi,

I'm trying to modify how our store displays the product name in the order-details.tpl, on the front end. The name is a concat of product name and product attirbutes. An example would be that we sell a tree called Apple with the attributes age, height and transport (that have each a value, and that are displayed "Appel - Age: 1, Height : 6', Transport : 9" (I assume this was standard in order-detail on ps 1.6).

I am trying to modify the controller to remove the mention "Transport : X".

I am having trouble navigating in all the class and functions of PS to solve this rather simple problem I guess.

I have come to the conclusion that I have to modify the initContent function around this :

$products = $order->getProducts();
                
                /* my insert*/
                foreach ($products as $p) {
                    
                        $pos_trs = strpos($p['product_name'], ', Transport');
                        
                        if ($pos_trs !== false) {
                            $p['product_name'] = substr($p['product_name'], 0, $pos_trs);
                        }    
                }
                
                /* end insert */ 

 

 

But I suppose I am not using the array $products properly.  I think $p['product_name'] doesn't exist in this form.  But I know that it's the value "$product_name" that is displayed in the order-detail.tpl that I want to change.

Could anybody help me with the syntax here?

Thanks A LOT!

 

JFD

Link to comment
Share on other sites

  • 2 weeks later...

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...