Kryptronic Software Support Forum

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.

#1 10-10-2014 17:06:50

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Product Detail Page & Social Media

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

 

#2 10-13-2014 07:54:07

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product Detail Page & Social Media

Under Store > Store Displays > Product Detail Displays, clone the 'Default' display.  Call yous 'Default No Extras' or whatever.  In there, strip these two codeblocks:

Code:

if ($placeextras == 'BELOWIMAGE') {

     $this->include_file('ecom','prodshowextras.php');

} // End of if statement.

Code:

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


Nick Hendler

Offline

 

#3 10-13-2014 08:29:31

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product Detail Page & Social Media

Nick

Very many thanks. It is easy when you know how :-)

Terry

Offline

 

#4 10-15-2014 16:25:48

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product Detail Page & Social Media

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

 

#5 10-16-2014 08:15:22

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product Detail Page & Social Media

Yes, in that one, you're going to have to replace:

Code:

$prodname  = $this->xhtml_encode($proddisp['name']);

With:

Code:

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


Nick Hendler

Offline

 

#6 10-17-2014 08:46:57

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product Detail Page & Social Media

Nick

It all makes perfect sense. Unfortunately, it doesn't appear to be working.

Terry

Offline

 

#7 10-17-2014 09:25:44

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product Detail Page & Social Media

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.


Nick Hendler

Offline

 

#8 10-17-2014 16:24:47

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product Detail Page & Social Media

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

 

#9 10-20-2014 12:56:01

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product Detail Page & Social Media

Right, that's why this should work:

Code:

$prodname  = $this->xhtml_encode(preg_replace('/^' . preg_quote($proddisp['prodnum'], '/') . ' \- /', '', $proddisp['name']));

Nick Hendler

Offline

 

#10 10-21-2014 04:18:08

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product Detail Page & Social Media

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

 

#11 10-21-2014 08:53:40

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product Detail Page & Social Media

To change that H1 tag, right below the code you added, add one more line, only in your product detail page:

Code:

$this->globals('core.ref_disp',$prodname);

Nick Hendler

Offline

 

#12 10-21-2014 12:04:28

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product Detail Page & Social Media

Excellent, thank you very much.

Terry

Offline

 

#13 04-29-2015 13:16:35

kgillespie
Member
From: Sandy, Oregon
Registered: 06-10-2004
Posts: 164
Website

Re: Product Detail Page & Social Media

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

 

#14 05-04-2015 07:18:43

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product Detail Page & Social Media

System Dashboard > Store > Component > Settings > Product Detail Pages

^^^ You found it.


Nick Hendler

Offline

 

#15 05-27-2015 05:58:11

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product Detail Page & Social Media

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

 

#16 05-28-2015 05:53:50

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19951
Website

Re: Product Detail Page & Social Media

In {private}/apps/ecom/ECOM_Prod/ECOM_Prod.php, look for the following in the prodshow() function:

Code:

$this->breadcrumbs($product['name'],0);

Change to:

Code:

$this->breadcrumbs(preg_replace('/^' . preg_quote($product['prodnum'], '/') . ' \- /', '', $product['name']),0);

Nick Hendler

Offline

 

#17 05-28-2015 11:49:47

tguswell
Member
From: Plymouth, Devon
Registered: 07-31-2010
Posts: 128
Website

Re: Product Detail Page & Social Media

Excellent - thank you very much Nick.

Regards

Terry

Offline

 

Board footer