Page 3 of 4

Re: OpenCart Shortcodes

Posted: Tue Jun 09, 2015 10:31 am
by qahar
Shorcodes v2.0.1 release!

== Fix
- OpenCart 2 customer group id

Re: OpenCart Shortcodes

Posted: Fri Jul 10, 2015 9:29 pm
by qahar
Shorcodes v2.0.2 release!

== Fix
- Fixed load model for information

Re: OpenCart Shortcodes

Posted: Fri Jun 03, 2016 8:50 pm
by lockiedownunder
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';
		}
   }

Re: OpenCart Shortcodes

Posted: Fri Jun 03, 2016 9:04 pm
by lockiedownunder
Shortcodes don't work on search results product description.

Re: OpenCart Shortcodes

Posted: Sat Jun 04, 2016 4:24 pm
by lockiedownunder
Is there a way shortcodes can be used in Meta Tag Title and Meta Tag Description?

Re: OpenCart Shortcodes

Posted: Sat Jun 04, 2016 4:57 pm
by lockiedownunder
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>

Re: OpenCart Shortcodes

Posted: Sat Jun 04, 2016 8:52 pm
by qahar
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

Re: OpenCart Shortcodes

Posted: Sat Jun 04, 2016 10:55 pm
by qahar
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

Re: OpenCart Shortcodes

Posted: Sun Jun 05, 2016 6:21 am
by lockiedownunder
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.

Re: OpenCart Shortcodes

Posted: Sun Jun 05, 2016 6:35 am
by qahar
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

Re: OpenCart Shortcodes

Posted: Tue Jun 07, 2016 4:09 pm
by lockiedownunder
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

Re: OpenCart Shortcodes

Posted: Mon Jun 27, 2016 8:17 pm
by labeshops
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.

Re: OpenCart Shortcodes

Posted: Tue Jun 28, 2016 1:34 am
by qahar
No default shortcodes can do that. But you can make your own shortcodes.
I suggest you to read shortcodes developer refferance.

Re: OpenCart Shortcodes

Posted: Tue Jun 28, 2016 3:32 am
by labeshops
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.

Re: OpenCart Shortcodes

Posted: Fri Aug 05, 2016 4:50 am
by Cue4cheap
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

Re: OpenCart Shortcodes

Posted: Fri Aug 05, 2016 11:19 pm
by qahar
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.

Re: OpenCart Shortcodes

Posted: Sat Aug 13, 2016 4:06 am
by mtjhost
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

Re: OpenCart Shortcodes

Posted: Sat Aug 13, 2016 2:43 pm
by qahar
what is your opencart version?

Re: OpenCart Shortcodes

Posted: Tue Sep 27, 2016 1:29 pm
by techmatters
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

Re: OpenCart Shortcodes

Posted: Wed Sep 28, 2016 6:56 am
by qahar
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.