Jump to content

[MODULE] - Product Accessories


Recommended Posts

Display the Product Accessories in a more visible place, and hide it from the tabs section.

By Default the module is hooked to "Extra Right" (below the add to cart button).

To display the accessories horizontally (above "More info"), transplant the module to the "Product Footer" hook (Modules->Positions->Translational a module). Also available in Left + Right columns.

Tested on PrestaShop V1.4, 1.5 and 1.6.x

Available at http://www.presto-ch...ccessories.html

 

Direct Download: http://bit.ly/1lJKndc


V1.2 released, it includes

* New hook ProductFooter (for horizontal display)
* Support for PS 1.4


V1.3 released, it includes
* Added new Left + Right Column hooks.
* Code cleanup and optimization (CSS)
* Fix for product price excluding tax display.
* Added scrollbar to Product Footer hook.


V1.3.1 released
* Fix for CSS (not being included in certain cases).

V1.4 released
* Support for PS 1.5

 

v1.5 released
* Added support for PrestaShop 1.6
* Responsive front-office

post-20153-0-78372500-1403461458_thumb.png

post-20153-0-98523900-1403461462_thumb.jpg

  • Like 7

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 2 weeks later...

Très sympa le module ! Seul souci : l'onglet "accessoire" reste toujours visible :(

Traduct with google translate : Very nice module! Only one problem: The tab "accessory" is still visible: (

Share this post


Link to post
Share on other sites
Très sympa le module ! Seul souci : l'onglet "accessoire" reste toujours visible :(

Traduct with google translate : Very nice module! Only one problem: The tab "accessory" is still visible: (


There could be two reasons why:

1) There is a javascript error on the page.
2) You changed the accessories tab code.

If you post the URL, I could take a look.

Share this post


Link to post
Share on other sites

Je n'ai changé que la couleur à partir du global.css. Est-ce que ça viendrait de la ?

Traduct with google translate : I changed the color from global.css. Does it come in?


Ligne 109 :
ul.idTabs li a {
background-image:url("../img/tab_bg.jpg");
color:white;
display:block;
font-weight:bold;
height:18px;
padding-top:3px;
text-align:center;
text-decoration:none;
text-transform:uppercase;
width:173px;



Thank you for you support.

Share this post


Link to post
Share on other sites
  • 5 months later...

Tomer,

Hi! I currently own your Attribute Wizard Pro module as well as a free module and love them both. I was recently attempting to add this module and it worked fine in it's default position, but I wanted it to show above the default PS Products Category module. I moved the hook in product.tpl, but would like it to show 4 columns across and only one row, instead of the default 2x2.

I looked over the productaccessories.tpl several times, but don't see where it says "only show x number of products across". There doesn't seem to be a place to do this in the javascript or php files either, but perhaps I'm overlooking something.

Could you point me in the right direction?

Share this post


Link to post
Share on other sites

Thanks, I'm glad you like them...

In the tpl file on line 41

       {if $smarty.foreach.accessories_list.iteration % 2 == 0}
 
       {/if}


The separator is added every 2 products, you can change the 2 to 4

Share this post


Link to post
Share on other sites

Tomer,

Oh, too easy. I have so many blonde moments with your modules! It's one of those moments where you smack yourself in the forehead. :)

Also, for anyone else doing something similar, don't forget to change style="width:50%; on line 27 of the tpl file to whatever percentage you need for the # of images you want across (i.e. 5 images = 20%).

Thanks so much!

Share this post


Link to post
Share on other sites
  • 3 weeks later...

hello,

Pls.help me. if i need to add group attribute on each product in product accessories section. how can i do?
please give me a sample code.

Thanks a lot

koii

Share this post


Link to post
Share on other sites

I'm not really sure what you're asking. Can you elaborate a little more? You are trying to display the attributes for your accessories on the product page of another product?

Share this post


Link to post
Share on other sites
hello,

Pls.help me. if i need to add group attribute on each product in product accessories section. how can i do?
please give me a sample code.

Thanks a lot

koii


There's no quick fix / solution to show the attributes for accessories.

I may make a special module for that at some point.

Share this post


Link to post
Share on other sites
I'm not really sure what you're asking. Can you elaborate a little more? You are trying to display the attributes for your accessories on the product page of another product?


yes, that's right. I need to show the attributes group in product accessories (module) on the product page
and i try to copy code of attributes to product accessories module position but the result is the same main product page. i'm not sure are you understand me.please see my web that has a problem below

http://www.dellarobbiaoutdoor.com/shop/10-mo.html

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 1 month later...
Tomer,
... but I wanted it to show above the default PS Products Category module. I moved the hook in product.tpl, but would like it to show 4 columns across and only one row, instead of the default 2x2.

I looked over the productaccessories.tpl several times, but don't see where it says "only show x number of products across". There doesn't seem to be a place to do this in the javascript or php files either, but perhaps I'm overlooking something.


Hi Tomer
I too have the AWP and the accessories module and agree that the AWP has solved many problems.
I have tried to implement the solutions given to the above post by you but I have not got it quite right!
Thanks, I'm glad you like them...

In the tpl file on line 41
       {if $smarty.foreach.accessories_list.iteration % 2 == 0}
 
       {/if}




I would like the accessoriesblock to appear just below the awp_container (and therefore above the more_info_block). I am not sure how I need to edit the product.tpl file to acheive this.
Can you help please?

Ferg

Share this post


Link to post
Share on other sites

Very usefull module. The first install put the module on the right of product page. I just want to put it on a specific tab under "more info" and data sheet, center on my product block. Is it possible ?
Thanks in advance,
Mat

Share this post


Link to post
Share on other sites

the whole purpose of the module is to move the accessories from the tab where they are originally to a more visible place.

There will be an option to place them in the center column in the coming weeks.

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 4 weeks later...


I would like the accessoriesblock to appear just below the awp_container (and therefore above the more_info_block). I am not sure how I need to edit the product.tpl file to acheive this.
Can you help please?

Ferg


Hi Tomer
Any let up in your workload? :)
Wondering if there is any progress on this module. Would be really helpful for clients.

Thanks

Ferg

Share this post


Link to post
Share on other sites

To display the accessories horizontally (above "More info"), transplant the module to the "Product Footer" hook (Modules->Positions->Transplant a module).

Is it also possible to put it under the product description?

Share this post


Link to post
Share on other sites
Kokkekniven & misa: You can create a new hook and place the module there, you may have to create a new tpl / CSS code for it.


Thanks.....but that's for me to difficult

Share this post


Link to post
Share on other sites

Great module - thanks for the update

How can i add a background to the accesories text because i want to use the same button/bg as the other tabs i have.

This is what i will like to have behind the text

http://www.homeshop.dk/themes/prestashop/img/tab_bg_selected.jpg

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Thank Your very much .
The module looks very nice. I installed it on my german-prestashop edition version 1.2.5., without problemes.
But it is not displayed on the page / frontend. No Error Messages or something else.

could be there a problem with the german edition ?

would be glad bout some help :)
thx

Share this post


Link to post
Share on other sites

Thank your for fast answering :)

I have transplated it in the ProductFooter, but the same error.
It is not displayed.
I´ve also changed some lines of the productaccessoires.php.


<?php

class ProductAccessories extends Module
{
function __construct()
{
$this->name = 'productaccessories';
$this->tab = 'Presto-Changeo';
$this->version = "1.2";

parent::__construct();

$this->displayName = $this->l('Product Accessories');
$this->description = $this->l('Display product accessories in a more visible location.');
}

function install()
{
if (!parent::install())
return false;
if (!$this->registerHook('productFooter') || !$this->registerHook('header'))
return false;
return true;
}

/**
* Returns module content
*
* @param array $params Parameters
* @return string Content
*/
function hookProductFooter($params)
{
global $smarty, $cookie, $protocol_content, $server_host;

$product = new Product(intval($_GET['id_product']), true, intval($cookie->id_lang));
$accessories = $product->getAccessories(intval($cookie->id_lang));
if (sizeof($accessories) < 1)
return;
$images = $product->getImages(intval($cookie->id_lang));
$smarty->assign('pa_is_image', sizeof($images));
$smarty->assign('pa_accessories_dir', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/');
$smarty->assign('accessories', $accessories);
$smarty->assign('pa_old_img', floatval(substr(_PS_VERSION_,0,3)) < 1.2?'1':'');
return $this->display(__FILE__, 'productaccessories.tpl');
}

function hookHeader()
{
global $smarty, $page_name;
if ($page_name != 'product')
return;
$ps_version = floatval(substr(_PS_VERSION_,0,3));
if ($ps_version < 1.4)
return $this->display(__FILE__, 'header.tpl');
else
{
Tools::addCSS(($this->_path).'css/pa.css', 'all');
Tools::addCSS(($this->_path).'css/jScrollPane.css', 'all');
Tools::addJS(($this->_path).'js/jquery.mousewheel.js');
Tools::addJS(($this->_path).'js/jScrollPane.js');
}
}

function hookProductFooter($params)
{
global $smarty, $cookie, $protocol_content, $server_host;

$product = new Product(intval($_GET['id_product']), true, intval($cookie->id_lang));
$accessories = $product->getAccessories(intval($cookie->id_lang));
if (sizeof($accessories) < 1)
return;
$images = $product->getImages(intval($cookie->id_lang));
$smarty->assign('pa_is_image', sizeof($images));
$smarty->assign('pa_accessories_dir', $protocol_content.$server_host.__PS_BASE_URI__.'/modules/'.$this->name.'/');
$smarty->assign('accessories', $accessories);
$smarty->assign('pa_old_img', floatval(substr(_PS_VERSION_,0,3)) < 1.2?'1':'');
return $this->display(__FILE__, 'productaccessoriescenter.tpl');
}
}
?>




:(

Share this post


Link to post
Share on other sites

I'm not sure as I never tried it on the German edition.

try to turn on error reporting in /config/config.inc.php and see if there are any errors in the front end.

Share this post


Link to post
Share on other sites

Ok , tried it with english version. same thing. doesnt work.

My Steps, that i made.

Downloaded the file at PrestoChangeo Page.

Uploaded it by Prestashop ---> Download succesfully, module installed.

Translated the ProductAccessoires to the Product Footer.

that is all...

Is there a step, which i forgot to do ? Do i have to change maybe something in the Accesoires Category ?

Share this post


Link to post
Share on other sites

It is a fresh installed Prestashop version.
So i think, that there have to be assigned accessoires to the iPod for example.

There is no change, when i disable the module. I also don´t see the accessoires in the tab ( next to more info )

you can see it here : www.simpod.de ( without working module )

Share this post


Link to post
Share on other sites

I don't think you quite understand the way product accessories work.

Make sure you get them working before trying the module....

Edit a product and look at the bottom of the page, that's where you define accessories.

Share this post


Link to post
Share on other sites
  • 2 weeks later...

You will have to edit the code for that in the tpl file, I have not tried to use this scroller in that way before, so I can't offer any tips.

Share this post


Link to post
Share on other sites

thanks for the quick reply, i assume this can be done just by editing the tpl file then? No changes are to be made to the js file??

You will have to edit the code for that in the tpl file, I have not tried to use this scroller in that way before, so I can't offer any tips.

Share this post


Link to post
Share on other sites
  • 2 weeks later...

Tomer,

Then i transplant module to "Product footer", another one at extraright didn't disapeare.
At extraright it is with scroll, at footer witout it.
I checked position, so there i have two entrys: Header of pages and Product footer.
Then i deleted form Header of pages, bove blocks crached.

So there could be problem?

PS 1.3.1

[sOLVED]
I was hiden "all position", so find module at extra and deleted.

However, one more question. In horizontal position block is without scroll or there one more "bug" on my side?

Share this post


Link to post
Share on other sites
  • 3 weeks later...

any idea how to delete the block under the ADD TO CART button?
iv followed the tutorial but cant seem the get rid of it.
i have also done the transplant to Product Footer which i like. but the Block on the right is annoying

see attached picture.

please help :)

43153_aUgdPJ5i9oDDl5fvNANq_t

Share this post


Link to post
Share on other sites
  • 3 weeks later...
any idea how to delete the block under the ADD TO CART button?
iv followed the tutorial but cant seem the get rid of it.
i have also done the transplant to Product Footer which i like. but the Block on the right is annoying

see attached picture.

please help :)


try to find in Right column blocks.

i hope to help.

------------------------------------------------------

Thanks for share!!!

Anyways, i see, u have to fix scroll in Product footer, but, if i have only 1 accesorie, he looks outside of table.. but if i have more, then looks inside.

That can be fixed?

Thanks again!

Share this post


Link to post
Share on other sites

hey thanks for the replys :)

iv managed to get the "right" box deleted, but struggling with the Scroll box.
i find that when i add more than 4 items(accessories) it jumps outside the box? any idea on how to fix this?

Share this post


Link to post
Share on other sites
hey thanks for the replys :)

iv managed to get the "right" box deleted, but struggling with the Scroll box.
i find that when i add more than 4 items(accessories) it jumps outside the box? any idea on how to fix this?


Scroll dont works in Product Footer. will be fixed, i hope.

If is in Extra-right-collumn, i think works..

I try to fix when is more then 4 products they go outside of box

in productaccesoriescenter.tpl

{if $smarty.foreach.accessories_list.iteration % 5 == 0}



i changed to

{if $smarty.foreach.accessories_list.iteration % 8 == 5}



works for me.

Share this post


Link to post
Share on other sites
  • 3 months later...

hey thanks for the replys :)<br/><br/>iv managed to get the "right" box deleted, but struggling with the Scroll box.<br/>i find that when i add more than 4 items(accessories) it jumps outside the box? any idea on how to fix this?

 

 

Hi,

 

how do you managed to get the 'right' box remove?

In my position, nothing is hooked to my right column. I only have product accessories hooked to the product footer but i am seeing double of the accessories on my product page.

 

Thanks!

Share this post


Link to post
Share on other sites

hey thanks for the replys :)<br/><br/>iv managed to get the "right" box deleted, but struggling with the Scroll box.<br/>i find that when i add more than 4 items(accessories) it jumps outside the box? any idea on how to fix this?

 

 

Hi,

 

how do you managed to get the 'right' box remove?

In my position, nothing is hooked to my right column. I only have product accessories hooked to the product footer but i am seeing double of the accessories on my product page.

 

Thanks!

 

Hi,

 

sorry, found the solution. :P

 

One more help tho.. how can i move the block to be below of more info?

 

Thanks, love your modules! :)

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 3 weeks later...

This may be a very easy question :unsure: but I am using the Matrice template and would like to change the add to cart button from green to white to match the rest.

 

Can you tell which code I have to change? I have looked in productaccessories.tpl, but can't find the green colour!

 

Thanks,

 

ok found the code and changed it!

Edited by lisajef (see edit history)

Share this post


Link to post
Share on other sites
  • 1 month later...

Hi Tomerg3

 

I've one question can i edit css ? or global css ? to change the colour ?

I want the colors to be like on the screenshot I've made.

Can you help me ?

 

And thx you for sharing free modules !

Share this post


Link to post
Share on other sites

This may be a very easy question :unsure: but I am using the Matrice template and would like to change the add to cart button from green to white to match the rest.

 

Can you tell which code I have to change? I have looked in productaccessories.tpl, but can't find the green colour!

 

Thanks,

 

ok found the code and changed it!

 

 

Hello, can you say me how edit ? I want to change the color of the table. Thx

Share this post


Link to post
Share on other sites
  • 4 weeks later...

Great module. I am doing a couple of modifications such as adding a spanish button, and getting rid of the small "product name/link" and replacing the "Accessories" for "Customers who purchased this also purchased".

 

I encountered an issue when I transplanted the module to the product footer and unhooked from "Extra Right" but now it displays on both locations. Is there additional code alteration that need to be done in order to display it only at product footer? Thanks, by the way great module :D

Share this post


Link to post
Share on other sites

There is something overriding the productaccessories.tpl file because I changed Accessories for Accesorios but it still displays the Enlgish word even though it's changed on the server. I also have the translations displaying the word in Spanish.

 

[sOLVED]

 

You need to force compile, still struggling with ridding of the module on the right :(

Share this post


Link to post
Share on other sites
  • 3 weeks later...

V1.3 released, it includes

* Added new Left + Right Column hooks.

* Code cleanup and optimization (CSS)

* Fix for product price excluding tax display.

* Added scrollbar to Product Footer hook.

Share this post


Link to post
Share on other sites
  • 2 weeks later...
  • 2 weeks later...

Thank very much for great module.

 

But I have some critical problems. You can see screenshot.

 

I use PS 1.4.7.0 and Firefox 10.0.2

 

I really feel the same. Today I downloaded the latest version and does not load js and css. Today I downloaded the latest version.

Sorry for my English

Share this post


Link to post
Share on other sites
  • 5 weeks later...

Hey,

Thank you for your module, you made a really good job but i have one problem. Like in the picture i am trying to move module to be only in a product footer but i can't remove it from its' standard place.

 

I have transplanted it to the product footer and remove other hooks and i don't have any idea now what to do next.

 

I will appreciate any help.

post-305435-0-01971500-1333996164_thumb.png

Share this post


Link to post
Share on other sites

Uninstall and install again to restore all the hooks (They are all needed).

 

Then check the non-positional box, and remove it from "Extra Right"

Share this post


Link to post
Share on other sites

Thank you for such a fast reply. I did as you said and there is a kind of new problem. After i had reinstalled the module, it automatically looked better than before (picture attached). Problem now is that when i transplant the hook to the product footer it doesn't appear on the site. It's still showing only standard hook. When i remove it as you said from extra right, nothing appears on the site.

 

It's strange becouse before i reinstalled the module it had appeared when i had transplanted it to the product footer but had looked badly. Now it looks good but i can't move it to product footer. I tried to move it to the left column, right column and it works perfectly.

 

Have you any ideas what is the problem ?

post-305435-0-94482500-1334004367_thumb.png

Share this post


Link to post
Share on other sites

I sent you a pm.

 

Yesterday i didn't noticed one thing. In standard configuration everything look fine (before.png) but after adding hook to product footer it looks like it actually is behind the photo (after.png).

post-305435-0-83213200-1334062765_thumb.png

post-305435-0-60029700-1334062771_thumb.png

Share this post


Link to post
Share on other sites
  • 1 month later...
  • 3 weeks later...

Hello,

Does anyone has a language file for this module?

I prefere dutch, but german, french or espanol will do just fine.

I keep getting time-outs when i want to translate the modules. I delted a few modules but still the smae effect..

 

Thanks!

Share this post


Link to post
Share on other sites
  • 2 weeks later...

The module is great!

 

I need to make one change though. I want to change the "add to cart" button to view item button. I just want it to go to the item when clicked instead of adding to the cart.

 

Can I change something in the productaccessoriescenter.tpl to change the add to cart button? Below is a copy of the code for the "Add" button.

 

 

<div class="pa_pf_atc"><a class="button_small exclusive_small ajax_add_to_cart_button" href="{$base_dir}cart.php?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart' mod='productaccessories'}">{l s='Add' mod='productaccessories'}</a></div>

 

any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
  • 2 weeks later...

HI and thanks for that !

I have a problem with the display : it appears in the middle of the product page. I hooked it on the right block but is still in the middle (+in the right block ... <_< ).

 

How can I get it off ?

Thanks !

Share this post


Link to post
Share on other sites
  • 3 weeks later...

Hello!

First, thank you for this module.

 

It works well but I can't translate it (in French) in the back office... When I try, I can save but nothing changes in this module :s

Does anyone have the same issue?

Share this post


Link to post
Share on other sites
  • 1 month later...

Hello,

 

I've installed the module, its great but it doesnt show the scroll bar in product footer, can you tell me how to enable it?

 

LE: now in some products the module doesnt display correctly, take a look here next to short descr, have any ideea what could it be?

 

Thanks

 

17ppp5.jpg

Edited by rusteh (see edit history)