Page 1 of 1

Need product model variable in footer.tpl

Posted: Sat Apr 07, 2012 12:25 am
by stonehinged
Can anyone provide assistance that would help me return the product model variable in footer.tpl preferably with a vQmod? I'm using 1.5.2.1

Ideally,
if:
on a product page the variable is returned for that product,
on a category page the variable is returned for the first product listed,
on a checkout page the variable is returned for the first product in the cart,

else if:
not any of these pages the variable returns null.

Way too complicated for my programming skill level :o

Thanks for any help!

Re: Need product model variable in footer.tpl

Posted: Sat Apr 07, 2012 5:29 am
by JAY6390
The only way I can think of is to pass this to the document object and then retrieve it using the footer controller, however something like that isn't as simple as it sounds

Re: Need product model variable in footer.tpl

Posted: Sat Apr 07, 2012 10:20 pm
by stonehinged
Thanks Jay, figured as much, simply beyond my capabilities. But that never keeps me from trying and experimenting.

For now I'd be happy with it returning a product model number if on the product page and null if any other page.

Thanks for replying back.

Re: Need product model variable in footer.tpl

Posted: Sat Apr 07, 2012 10:27 pm
by JAY6390
Note this is untested

/catalog/controller/common/footer.php
Add this code before the render:

Code: Select all

$model = false;
if(!empty($this->request->get['route']) && $this->request->get['route'] == 'product/product' && !empty($this->request->get['product_id'])) {
    $product_id = (int)$this->request->get['product_id'];
    $this->load->model('catalog/product');
    $product = $this->model_catalog_product->getProduct($product_id);
    if($product) {
        $model = $product['model'];
    }
}

$this->data['model'] = $model; 
In the footer.tpl file, wherever you want the model, use

Code: Select all

<?php if(!empty($model)) echo $model; ?>

Re: Need product model variable in footer.tpl

Posted: Mon Apr 09, 2012 2:27 am
by stonehinged
Jay... brilliant! I can't thank you enough!

It has worked perfectly in my vQmod.

Hats off! You guys that know what you're doing really rock! I wish I had your talents. This latest code for Google Trusted Stores has been a bear but this should fulfill the requirement.

Thanks so much again!

Re: Need product model variable in footer.tpl

Posted: Wed Jun 13, 2012 9:14 pm
by Demon5
I received the below email from trusted stores. How did you go about the feeds? Could use a vqmod for this on 1.5.2.1+


Hello,

Thank you for applying for the Trusted Stores program! We see that you've completed part of the signup process and wanted to follow up with you regarding next steps.

We've reviewed your integration and noticed that while you have successfully set up your account, the shipment and cancellation data feeds as well as the the badge and opt-in module JavaScript elements must all be implemented before we can start reviewing your application.

Please see the following links for more details:
http://support.google.com/trustedstores ... er=2609890
http://support.google.com/trustedstores ... er=2609894

Please let us know once both the data feeds and JavaScript elements are in place, and feel free to reach out if you have any questions!

Sincerely,
The Google Trusted Stores Team