Post by qahar » Tue Jun 09, 2015 10:31 am

Shorcodes v2.0.1 release!

== Fix
- OpenCart 2 customer group id

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by qahar » Fri Jul 10, 2015 9:29 pm

Shorcodes v2.0.2 release!

== Fix
- Fixed load model for information

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by lockiedownunder » Fri Jun 03, 2016 8:50 pm

For the benifit of others I created the following code so I can manipulate the description of a product based on which store of my multi store site you are on. I'm sure there are better ways but this worked for me.

So by inserting [sitename /] into a product description I get the appropriate company name/store name helping to make the two stores a little more unique.

Code: Select all

function sitename() {
		$current_store    = $this->config->get('config_url');
		if ($current_store == 'http://www.XYZ.com/') {
			return 'XYZ Company';
		} 
		else {
			return 'AAA Company';
		}
   }

New member

Posts

Joined
Sun Nov 01, 2015 3:00 pm

Post by lockiedownunder » Fri Jun 03, 2016 9:04 pm

Shortcodes don't work on search results product description.

Attachments

ScreenClip.png

ScreenClip.png (85.19 KiB) Viewed 9324 times


New member

Posts

Joined
Sun Nov 01, 2015 3:00 pm

Post by lockiedownunder » Sat Jun 04, 2016 4:24 pm

Is there a way shortcodes can be used in Meta Tag Title and Meta Tag Description?

New member

Posts

Joined
Sun Nov 01, 2015 3:00 pm

Post by lockiedownunder » Sat Jun 04, 2016 4:57 pm

Ok to achieve shortcodes in Meta Title and Meta Description I added the following code after line 89 in xml file in vqmod directory.

This helps me to create unique meta data for each product in my multi store

Code: Select all

<file name="catalog/controller/product/product.php">
      <operation error="log" info="Parse shortcodes at meta tag title">
         <search position="after"><![CDATA[['meta_title']]]></search>
         <add><![CDATA[
		 $this->document->setTitle($this->shortcodes->do_shortcode($product_info['meta_title']));
         ]]></add>
      </operation>
	  <operation error="log" info="Parse shortcodes at meta tag title">
         <search position="after"><![CDATA[['meta_description']]]></search>
         <add><![CDATA[
		 $this->document->setDescription($this->shortcodes->do_shortcode($product_info['meta_description']));
         ]]></add>
      </operation>
   </file>

New member

Posts

Joined
Sun Nov 01, 2015 3:00 pm

Post by qahar » Sat Jun 04, 2016 8:52 pm

lockiedownunder wrote:So by inserting [sitename /] into a product description I get the appropriate company name/store name helping to make the two stores a little more unique.
String comparison could be different between http and https
You can return config_name wich represent Admin > System > Setting > Edit > Tab Store > Store Name input
This will also make your shortcode more flexible for usage in future

Code: Select all

public function sitename() {
    return $this->config->get('config_name');
}
Yes you can use $this->shortcode->do_shortcodes() to parse shortcode in any content

Thank you for reporting search issue, I will fix it soon

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by qahar » Sat Jun 04, 2016 10:55 pm

Shorcodes Updates

* Fixed
^ Improvements
+ New Feature
~ Deprecated
# New Feature - Feedback Expected

=== v2.1.1
^ Improve [link_store] db query
^ Add shortcodes support in search page

=== v2.0.4
^ Add shortcodes support in search page

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by lockiedownunder » Sun Jun 05, 2016 6:21 am

Thank you for your response and hint above much appreciated.

I have a bit of a glitch. I have two items on the featured module but one of them is not processing the shortcode.
The shortcodes are the same in both cases and I have checked the source to ensure code is identical in both.

Attachments

ScreenClip.png

ScreenClip.png (109.28 KiB) Viewed 9300 times


New member

Posts

Joined
Sun Nov 01, 2015 3:00 pm

Post by qahar » Sun Jun 05, 2016 6:35 am

Other possibilities is the shortcode tags truncated by desc limit.
May be I should change how it works, do_shortcode then let desc limit truncate.
Currently I do_shortcode from desc truncated result

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by lockiedownunder » Tue Jun 07, 2016 4:09 pm

qahar wrote:Other possibilities is the shortcode tags truncated by desc limit.
May be I should change how it works, do_shortcode then let desc limit truncate.
Currently I do_shortcode from desc truncated result
That would give a more uniform view as at the moment different products take up more space than others and makes the page look a little funny

New member

Posts

Joined
Sun Nov 01, 2015 3:00 pm

Post by labeshops » Mon Jun 27, 2016 8:17 pm

Trying to figure out how I can pull certain products onto an info page based on a tag on those products?? Is there a way I can do this using shortcodes? I want to highlight a certain shoe theme that currently has about 24 different styles. I have the same tag on all, just now need to write copy on an info page then include those products on the page. Thought the easiest way might be by using a shortcode.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by qahar » Tue Jun 28, 2016 1:34 am

No default shortcodes can do that. But you can make your own shortcodes.
I suggest you to read shortcodes developer refferance.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by labeshops » Tue Jun 28, 2016 3:32 am

qahar wrote:No default shortcodes can do that. But you can make your own shortcodes.
I suggest you to read shortcodes developer refferance.
Okay, I'm not good at coding but will try to figure it out sometime. Thanks.

Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by Cue4cheap » Fri Aug 05, 2016 4:50 am

Maybe I am missing something BUT does shortcodes make possible to have the options to be placed into the description area of a product page?

Ie.....

This xyz thing is blah, blah, blah. It is available in: shortcode that represents (shows) options.


Thank you,
Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by qahar » Fri Aug 05, 2016 11:19 pm

It's possible but you need to create your own shortcode tags for that.

Example: [product_options id="3" /]

In the callback you need to check if current page is product page, check if current product page have options id 3 data; then show it.

In any case that you also need to show the same data in other page (not product page), the shortcode tags can be [product_options product_id="1" option_id="3" /]

FYI, unfortunately our docs is currently down and we are still migrating it to our own site.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by mtjhost » Sat Aug 13, 2016 4:06 am

We are getting the error

Fatal error: Call to undefined method Loader::library() in /home/store/public_html/system/helper/shortcodes_default.php on line 525

Please help how to resolve I am not a Developer

New member

Posts

Joined
Wed Apr 30, 2014 12:37 am

Post by qahar » Sat Aug 13, 2016 2:43 pm

what is your opencart version?

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by techmatters » Tue Sep 27, 2016 1:29 pm

Hi! First - great extension! I can see myself using this a *tonne*!

However, I'm having a bit of a problem integrating it into my site. It's running the Journal2 theme, but it's not so much the theme that's the problem, as much as the fact that I'm trying to put it into a custom tab (Journal2 lets you create any number of custom tabs on the Product Info page).

When I paste a shortcode into the "Description" field, it works fine. But if I paste it into content that will displayed in the tab beside the "Description" tab, it doesn't validate.

Is there any advice that you could possibly give? Thanks in advance!

-- Nathan

Newbie

Posts

Joined
Fri May 18, 2012 1:44 pm

Post by qahar » Wed Sep 28, 2016 6:56 am

You need to parse the shortcodes in journal2 tab description; docs.

Code: Select all

if (class_exists('Shortcodes') && method_exists($this->shortcodes, 'do_shortcode')) {
    $data['j2_tab_content'] = $this->shortcodes->do_shortcode($j2_tab_content);
}
Code above only example, you need to ask journal2 dev which part of the theme need to adapt to support Shortcodes ready.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia
Who is online

Users browsing this forum: Ahrefs [Bot] and 49 guests