Skip to Content
Account
Enter the email address on your account.
Forgot Your Username?
Enter your password.
Forgot Your Password?

Or continue with

J2Commerce 6

Social Media Sharing

12 Min Read

Documentation current for Social Media Sharing v6.0.9. Last checked November 17, 2026.

On This Page

Social Media Sharing adds share buttons for Facebook, Twitter/X, Pinterest, and LinkedIn directly to your product pages. Customers can share a product with a single click, and the plugin injects Open Graph and Twitter Card meta tags into each page so shared links display rich previews with product image, name, price, and availability. You choose which networks to show, where the buttons appear, and whether to use icon fonts or your own custom images.

Requirements

  • Joomla 6.0.0 or later
  • J2Commerce 6.6.4 or later
  • PHP 8.3 or later
  • At least one product created in J2Commerce

Installation

Social Media Sharing is a separate add-on available from the Social Media Share. It is not included with the core J2Commerce 6 component.

Step 1: Purchase and Download

  1. Go to the Social Media Share on the J2Commerce Extensions Store and navigate to Extensions.
  2. Locate Social Media Sharing, click View Details, then Add to Cart and complete checkout.
  3. After purchase, open your account and go to My Downloads.
  4. Find the Social Media Sharing app, click Available Versions -> View Files -> Download to get the app_socialmedia.zip file.

Step 2: Install

  1. In the Joomla admin panel, go to System -> Install -> Extensions.
  2. Drag and drop the app_socialmedia.zip file onto the upload area, or click Browse for file and select it.
  3. The plugin installs and enables itself automatically.

Enabling and Accessing Settings

After installation, the plugin is enabled automatically. To verify and open the settings:

Option A (via J2Commerce): Click the J2Commerce icon in the top-right admin toolbar -> Apps -> locate Social Media Sharing -> click the plugin name.

Option B (via Plugin Manager): Go to System -> Manage -> Plugins -> search for Social Media Sharing -> click the plugin name.

The settings are organized into five tabs: General, Facebook, Twitter, Pinterest, and LinkedIn.


Configuration

Tip

Click the Toggle Inline Help button in the toolbar and the app will show a description below each field as you configure it.

General Tab

The General tab controls where buttons appear, which product image is shared, and the share message text.

SettingWhat it controlsDefault
Pages to DisplayWhich page types show the share buttons: product detail page only, category/list pages only, or both.Product View
Display LocationThe exact position on the page where buttons are injected: relative to price, cart button, or article content. See the Display Location table below.After Add to Cart button
Social Share Product ImageWhich product image to use when building the share URL (Pinterest) and Open Graph tags: the main image or the thumbnail.Main Image
Image Width (px)Width in pixels for custom button images. This setting only affects buttons using Image mode, not icon mode.30
Share MessageThe opening text prepended to the product name in the share message. The product name is always appended automatically.Check this out!
Include Price in MessageWhen set to Yes, the formatted product price is appended to the share message in parentheses.Yes
Debug ModeWrites diagnostic entries to administrator/logs/plg_j2commerce_app_socialmedia.php. Always set to No on a live site.No

Pages to Display Options

OptionWhere buttons appear
Product ViewProduct detail pages only
Category ViewCategory/product list pages only
Product & Category ViewBoth product detail and list pages

Display Location Options

The Display Location dropdown controls which event hook the buttons attach to. The seven available positions are:

OptionWhere buttons appearWorks on
After product titleBetween the article title and the article bodyJoomla content (com_content) pages
Before product contentImmediately before the article body textJoomla content (com_content) pages
After product contentImmediately after the article body textJoomla content (com_content) pages
After Add to Cart buttonDirectly below the Add to Cart button (default)J2Commerce product views
Before Add to Cart buttonDirectly above the Add to Cart buttonJ2Commerce product views
Before product priceAbove the displayed priceJ2Commerce product views
After product priceBelow the displayed priceJ2Commerce product views

The first three options fire on Joomla's built-in content events (onContentAfterTitle, onContentBeforeDisplay, onContentAfterDisplay). They work when your products are displayed via Joomla articles or a content plugin. The last four options fire on J2Commerce-specific events and are the right choice for most stores using J2Commerce's native product templates.

Facebook Tab

SettingWhat it controlsDefault
Enable FacebookShow the Facebook share button. Also enables Open Graph meta tags on product pages when set to Yes.No
Image or IconIcon renders a CSS icon class; Image renders a custom uploaded image. Only shown when Facebook is enabled.Icon
IconThe CSS class string for the Facebook icon. Works with any icon library loaded by your template.fab fa-brands fa-facebook-f fs-2
Facebook ImageA custom button image uploaded via the Joomla Media Manager. Only used when Image or Icon is set to Image.-
Facebook App IDYour Facebook App ID from the Meta developer portal. Required for the fb:app_id Open Graph meta tag, which improves click tracking and enables Facebook Insights for your store pages.-
Facebook Contact EmailA contact email associated with your Facebook developer account, stored in plugin settings for reference.-

When Enable Facebook is set to Yes, the plugin injects a full set of Open Graph and Facebook Product Graph meta tags on product detail pages, including price, currency, availability, SKU, weight, brand, and category. See Open Graph and Twitter Card Meta Tags for details.

Twitter Tab

SettingWhat it controlsDefault
Enable Twitter (X)Show the Twitter/X share button.No
Image or IconIcon or Image mode for the button. Only shown when Twitter is enabled.Icon
IconCSS class for the Twitter/X icon.fab fa-brands fa-x-twitter fs-2
Twitter ImageCustom image for the button when in Image mode.-
Include Twitter Meta TagsInject Twitter Card meta tags into the page head. Can be set to Yes independently of whether the share button is enabled, which is useful when you want rich link previews without showing a share button.Yes
Personal Twitter AccountYour personal @username (without the @ symbol). Populates the twitter:creator meta tag.-
Website Twitter AccountYour site's @username (without the @ symbol). Populates the twitter:site meta tag.-
Product Image WidthWidth in pixels of the product image referenced in twitter:image:width. Set to 0 to omit this tag entirely.50
Description Limit (characters)Maximum number of characters from the product short description to include in twitter:description. The plugin trims at a word boundary.50
Twitter Card TypeSummary shows a small thumbnail. Summary Large Image shows a large hero image, which suits stores with high-quality product photography.Summary

Pinterest Tab

SettingWhat it controlsDefault
Enable PinterestShow the Pinterest share button.Yes
Image or IconIcon or Image mode for the button. Only shown when Pinterest is enabled.Icon
IconCSS class for the Pinterest icon.fab fa-brands fa-pinterest
Pinterest ImageCustom image for the button when in Image mode.-

Pinterest requires a product image to create a pin. If the product has no main image or thumbnail assigned, the Pinterest button is hidden automatically even when enabled. See Pinterest Behavior.

LinkedIn Tab

SettingWhat it controlsDefault
Enable LinkedInShow the LinkedIn share button.Yes
Image or IconIcon or Image mode for the button. Only shown when LinkedIn is enabled.Icon
IconCSS class for the LinkedIn icon.fab fa-brands fa-linkedin-in
LinkedIn ImageCustom image for the button when in Image mode.-

Custom Icons vs. Custom Images

Each social network button supports two display modes, controlled by the Image or Icon setting on each network's tab.

Icon Mode (Default)

The button renders as a <span> element with the CSS class you specify in the Icon field. Any icon library works: Font Awesome, Bootstrap Icons, UIkit Icons, or custom CSS. The default class strings use Font Awesome syntax:

fab fa-brands fa-facebook-f fs-2    (Facebook)
fab fa-brands fa-x-twitter fs-2     (Twitter/X)
fab fa-brands fa-pinterest          (Pinterest)
fab fa-brands fa-linkedin-in        (LinkedIn)

If your template does not load Font Awesome, these classes render as invisible elements. Either install a Font Awesome plugin, switch to Image mode, or replace the class with one from your template's icon library.

Image Mode

The button renders as an <img> element using a file you upload via the Joomla Media Manager. The image is displayed at the width set by Image Width (px) in the General tab (default: 30 px). Height scales proportionally.

To switch a button to Image mode:

  1. Open the plugin settings tab for that network (for example, the Facebook tab).
  2. Set Image or Icon to Image.
  3. Click the Facebook Image field and choose or upload an image using the Media Manager.
  4. Click Save.

Open Graph and Twitter Card Meta Tags

When a customer shares a product link or posts it in a chat, social platforms and messaging apps fetch the page and read meta tags to build a rich preview card showing the product name, image, price, and description instead of a bare URL.

What the Plugin Injects

On product list / category pages (only when Facebook is enabled):

  • og:type = product.group
  • og:url, og:title
  • og:image: the first product image found in the list
  • fb:app_id

On product detail pages (when Facebook is enabled):

  • Full Open Graph set: og:type, og:title, og:image, og:locale, og:price:amount, og:price:currency
  • Facebook Product Graph tags: product:price:amount, product:price:currency, product:availability, product:brand, product:category, product:retailer_item_id, product:upc, product:weight:value, product:original_price:amount, product:sale_price:amount

On product detail pages (when Include Twitter Meta Tags is set to Yes):

  • twitter:card: summary or summary_large_image depending on Twitter Card Type
  • twitter:site, twitter:creator
  • twitter:title: product name plus formatted price
  • twitter:image, twitter:image:width
  • twitter:description: truncated product short description

Why the Facebook App ID Matters

The fb:app_id meta tag tells Facebook which registered app owns this page. Without it, Facebook's link-preview crawler can still read your Open Graph tags, but you lose access to Facebook Insights data for those shared links. Creating a Facebook App ID is free: visit the Meta developer portal and register your site as an app.

Twitter Card Type: Summary vs. Summary Large Image

Summary (default): Shows a thumbnail-sized image on the left with text on the right. Suitable for any product image.

Summary Large Image: Shows a large banner image above the text. Requires an image of at least 300 x 157 px.

How to Test Your Meta Tags

After saving the plugin settings with Facebook and/or Twitter enabled, visit a product page on your site, then use these tools to verify what social platforms will see:

  • Facebook Sharing Debugger: developers.facebook.com/tools/debug. Paste a product URL to see the exact Open Graph tags Facebook reads. Use Scrape Again if a cached version appears.
  • Twitter Card Validator: cards-dev.twitter.com/validator. Paste a product URL to preview the Twitter Card.
  • Browser Developer Tools: View Page Source on any product page and search for og: or twitter: to see the raw meta tags.

Pinterest Behavior

Pinterest requires an image URL to create a pin. When the Pinterest button is clicked, the plugin passes the product image URL directly to Pinterest's pin creation dialog.

The button is shown only when a product image is available. The plugin checks in this order:

  1. The J2Commerce main image or thumbnail (depending on Social Share Product Image in the General tab)
  2. The Joomla article intro image associated with the product's source article
  3. The Joomla article full-text image

If none of these images are found, the Pinterest button is hidden even when Enable Pinterest is set to Yes. To make the button appear on all products, assign at least a main image to every product in the J2Commerce product editor.


Troubleshooting

The Plugin Will Not Install

The installer refuses the package when J2Commerce is older than 6.6.4 and shows "You are running an outdated version of J2Commerce. Version 6.6.4 or later is required." Update J2Commerce, then install the plugin again.

Share Buttons Do Not Appear Anywhere

Check 1: Plugin is enabled. Go to System -> Manage -> Plugins, search for Social Media Sharing, and confirm the status shows Enabled.

Check 2: At least one network is enabled. On the Facebook, Twitter, Pinterest, and LinkedIn tabs, set Enable [Network] to Yes for at least one network.

Check 3: Pages to Display matches your test page. If Pages to Display is set to Product View, the buttons do not appear on category listing pages. Set it to Product & Category View to test there.

Check 4: Display Location matches your template's event. The three content-event options only fire on Joomla article pages (com_content). If your products use J2Commerce's native product templates, choose one of the four J2Commerce-specific positions.

Check 5: Enable Debug Mode temporarily. Set Debug Mode to Yes, save, then reload a product page. Open administrator/logs/plg_j2commerce_app_socialmedia.php and look for entries from the plugin.

The Pinterest Button Is Missing but the Others Appear

Pinterest only renders when a product image is available. Open the product in the J2Commerce product editor and confirm that an image is assigned in the Images tab. Save the product, clear any caches, and test again.

If Social Share Product Image is set to Thumbnail Image, make sure the product has a thumbnail assigned.

Open Graph Meta Tags Are Not Appearing in the Page Source

Open Graph tags on product detail and list pages are only injected when Enable Facebook is set to Yes. Visit a product page, choose View Page Source, and search for og:title to confirm the tags are present.

Custom Button Image Is Not Showing

  1. Set Image or Icon for that network to Image.
  2. Re-open the media field and verify the file path is correct.
  3. Browse to the image URL directly to confirm your web server serves it.
  4. Set Image Width (px) in the General tab to a reasonable size, such as 30 to 60 px.

Icon Classes Are Not Rendering Visually

The default icon classes use Font Awesome syntax. If your template does not load Font Awesome, the <span> elements exist in the HTML but are invisible. Options:

  • Install a Font Awesome system plugin for Joomla.
  • Replace the icon class with one from your template's icon library (for example, bi bi-facebook for Bootstrap Icons).
  • Switch to Image mode and upload your own button images.

Share Message Contains Garbled Characters

The product name and share message are encoded with encodeURIComponent at click time. If you see double-encoded characters (for example, %2526), check whether another plugin also encodes URLs before the share dialog opens.


Related Products

Related Products

Still stuck? Our team can help.

Back to Top