You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
For the vast majority of my product pages I want to have the email a friend, Facebook, Twitter links available. However, for some of the products I would like to disable these links. I realise that I can have them all on or all off, but am I able to do what I want?
Many thanks.
Offline
Under Store > Store Displays > Product Detail Displays, clone the 'Default' display. Call yous 'Default No Extras' or whatever. In there, strip these two codeblocks:
if ($placeextras == 'BELOWIMAGE') {
$this->include_file('ecom','prodshowextras.php');
} // End of if statement.if ($placeextras == 'BELOWPRICE') {
print '<div style="height: 22px;"></div>' . $eol;
$this->include_file('ecom','prodshowextras.php');
} // End of if statement.Save that cloned display off. Now on any products you don't want those extra items showing up, use that display for the product's 'Product Detail Display Type' (Display tab under Store > Catalog > Products).
Offline
Nick
Forgot to ask. I show the product number on the majority of items but on the product display where I've turned off the social media links, I would like to remove the product number as well. Will I adjust this same file?
Terry
Offline
Yes, in that one, you're going to have to replace:
$prodname = $this->xhtml_encode($proddisp['name']);
With:
$prodname = $this->xhtml_encode(preg_replace('/^' . preg_quote($proddisp['prodnum'], '/') . ' \- /', '', $proddisp['name']));The number is prepended to the name in the function executed prior to the display being generated, so the number needs to be stripped out of the name prior to printing. If that makes sense...
Offline
Open a support ticket with us and we can take a look and debug/fix for a minimal charge. If the code I've posted here isn't working, I'll need to actually get my hands dirty with it to figure it out.
Offline
Nick
Your code is okay. I placed it in 'Product Detail Display Type' for the relevant products. Unfortunately the name (including product number) appears to be printed beforehand by 'Product List Displays', so editing the code in 'Product Detail Display Type' has no effect.
Terry
Offline
Right, that's why this should work:
$prodname = $this->xhtml_encode(preg_replace('/^' . preg_quote($proddisp['prodnum'], '/') . ' \- /', '', $proddisp['name']));Offline
Nick
Placing your code in the 'Product List Displays' it works - product numbers removed from display.
Placing your code in the 'Product Detail Display Type' it doesn't - the h1 tag (skin_pgtitle) is left unaltered.
As this was just to make the page 'look' nicer, I'll guess I'll leave as is and move on to other things.
Terry
Offline
I know where to go to empty out all of the social media links via System > Component > Settings > Social Media - but even with all of those empty I still see the social media buttons on the product detail page. How to turn them all off globally from showing up anywhere on the site is what I need to do?
Nevermind I think I just found it via: System Dashboard > Store > Component > Settings > Product Detail Pages
tguswell wrote:
For the vast majority of my product pages I want to have the email a friend, Facebook, Twitter links available. However, for some of the products I would like to disable these links. I realise that I can have them all on or all off, but am I able to do what I want?
Many thanks.
Last edited by kgillespie (04-29-2015 13:42:37)
Offline
Nick
A very belated follow up to my original question. On these pages where I've turned off the product number from being displayed it still shows up within the breadcrumb display. Where would I add the code from earlier to turn the product number off in the breadcrumb area?
Thanks
Terry
Offline
In {private}/apps/ecom/ECOM_Prod/ECOM_Prod.php, look for the following in the prodshow() function:
$this->breadcrumbs($product['name'],0);
Change to:
$this->breadcrumbs(preg_replace('/^' . preg_quote($product['prodnum'], '/') . ' \- /', '', $product['name']),0);Offline