Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Social Buttons > Email - shows on Pages when it shouldn't Rate Topic   - - - - -

 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 25 October 2013 - 11:45 PM #1

When the Email Social button is set to display for "Product details pages" only it displays on all "Pages".
Facebook button correctly obeys the settings.



Posted Image

CS-Cart 4.7.1


 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 29 October 2013 - 02:17 AM #2

Anyone? It appears this should be submitted as a bug?

Further note - with both Facebook and Email disabled for Pages the Add-on leaves about 20px of empty white space due to the following code. Top of the page isn't where I'd want the social buttons to start with (you want to like/share my page title?)
<div class="social-buttons social-buttons_blocks clearfix">
<div class="social-buttons_wrap"></div>
</div>

CS-Cart 4.7.1


 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 18 November 2013 - 03:13 AM #3

Support provided a code fix for the Email Social Buttons AddOn issue for pages - anyone needs it contact them or PM me.
Support acknowledged the Social Buttons AddOn + Pages space below the header issue as a bug for 4.x - no ETA for a fix.

CS-Cart 4.7.1


 
  • clips
  • Aged Resident Loon
  • Members
  • Join Date: 14-Jan 07
  • 1650 posts

Posted 18 January 2014 - 06:13 PM #4

Why not post it here for the community?
Regards,
Jim

 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 20 January 2014 - 02:03 PM #5

I'm newish to the community and wasn't sure if that was okay.
Here's the two Social Button bug fixes that worked for me in 4.0.2 and 4.0.3. Fix #2 is in the next post.

Fix #1 - Social Buttons "Display On" option bug.
When the Email Social button is set to display for "Product details pages" only it displays everywhere including on "Pages" like About, Contact etc. If you disable Email & Facebook for "Pages" then email will no longer show up for Products.


1. Open the app/addons/social_buttons/func.php file of your CS-Cart installation and add the following part of code to the end of the file:
function fn_email_prepare_settings($email_settings, $params)
{
if (empty($email_settings['email_display_on'][$params['object']]) || $email_settings['email_display_on'][$params['object']] != 'Y') {
	  return '';
	}
	
	return $email_settings;
}

Save the file.

2. Open the design/themes/basic/templates/addons/social_buttons/providers/email.tpl file and replace this line of code:
{if $addons.social_buttons.email_enable == "Y"}

with this one:
{if $addons.social_buttons.email_enable == "Y"  && $provider_settings.email.data}

Save the file.

3. Clear the template cache by renaming the var/cache directory.

CS-Cart 4.7.1


 
  • grafis
  • Junior Member
  • Members
  • Join Date: 12-Jan 11
  • 150 posts

Posted 20 January 2014 - 02:11 PM #6

Social Buttons fix #2 - When you disable Email and Facebook buttons for Pages there's a very large wasted white space between every page title heading and page content (a questionable location for Social Buttons - should be at the bottom of content imho). This is due to Button container code appearing even thought it's not needed:

1. Add this line of code:
Registry::get('view')->assign('display_button_block', fn_sb_display_block());

before this one:
Registry::get('view')->assign('provider_settings', fn_get_sb_provider_settings($params));

in the app/addons/social_buttons/controllers/frontend/pages.post.php file of your CS-Cart installation.

Save the file.

2. Add this line of code:
Registry::get('view')->assign('display_button_block', fn_sb_display_block());

before this one:
Registry::get('view')->assign('provider_settings', fn_get_sb_provider_settings($params));

in the app/addons/social_buttons/controllers/frontend/products.post.php file.

Save the file.

3. Add this part of code:
function fn_sb_display_block()
{
	$result = false;
	$settings = Registry::get('addons.social_buttons');
	if (!empty($settings)) {
		foreach ($settings as $setting_name => $setting_value) {
			if (strpos($setting_name, '_display_on') && is_array($setting_value)) {
				foreach ($setting_value as $value) {
					if ($value == 'Y') {
						$result = true;
						break;
					}
				}
			}
		}
	}
	return $result;
}
to the end of the app/addons/social_buttons/func.php file.

4. Replace this part of code:
<div class="clear"></div>
<ul class="social-buttons social-buttons_ul">
{foreach from=$provider_settings item="provider_data"}
	{if $provider_data && $provider_data.template}
	<li class="social-buttons_li clearfix">{include file="addons/social_buttons/providers/`$provider_data.template`"}	
	</li>
	{/if}
{/foreach}
</ul>

with this one:
{if $display_button_block}
	<div class="clear"></div>
	<ul class="social-buttons social-buttons_ul">
	{foreach from=$provider_settings item="provider_data"}
		{if $provider_data && $provider_data.template}
		<li class="social-buttons_li clearfix">{include file="addons/social_buttons/providers/`$provider_data.template`"
		</li>
		{/if}
	{/foreach}
	</ul>
{/if}


in the design/themes/basic/templates/addons/social_buttons/hooks/products/image_wrap.post.tplfile.

5. Replace this part of code:
<div class="social-buttons social-buttons_blocks clearfix">
{foreach from=$provider_settings item="provider_data"}
	{if $provider_data && $provider_data.template}
	<div class="social-buttons_wrap">{include file="addons/social_buttons/providers/`$provider_data.template`"
	</div>
	{/if}
{/foreach}
</div>

with this one:
{if $display_button_block}
	<div class="social-buttons social-buttons_blocks clearfix">
	{foreach from=$provider_settings item="provider_data"}
		{if $provider_data && $provider_data.template}
		<div class="social-buttons_wrap">{include file="addons/social_buttons/providers/`$provider_data.template`"}
		</div>
		{/if}
	{/foreach}
	</div>
{/if}

in the design/themes/basic/templates/addons/social_buttons/hooks/pages/page_content.pre.tplfile.

6. Clear the template cache by renaming the var/cache directory.

CS-Cart 4.7.1


 
  • winggeek
  • Newbie
  • Members
  • Join Date: 12-Mar 15
  • 5 posts

Posted 08 April 2015 - 09:07 AM #7

Does anyone know how to move the current social button position ( tweet, FB like and share ) on the content page to align to the right hand side of the page title ?

i am in the page view in file editor - templates / views / pages / view.tpl

when i change this code i am still stuck on how to change the layout.

any ideas ?

CS CART MV 4.4.1 (4)


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20929 posts

Posted 08 April 2015 - 11:42 AM #8

Does anyone know how to move the current social button position ( tweet, FB like and share ) on the content page to align to the right hand side of the page title ?

i am in the page view in file editor - views / view.tpl

when i change this code i am still stuck on how to change the layout.

any ideas ?


Please PM me URL of your website
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)