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.
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';
}
}
Shortcodes don't work on search results product description.
Attachments
ScreenClip.png (85.19 KiB) Viewed 9466 times
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
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>
String comparison could be different between http and httpslockiedownunder 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.
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');
}
Thank you for reporting search issue, I will fix it soon
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
* 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
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.
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 (109.28 KiB) Viewed 9442 times
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 funnyqahar 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
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.
No default shortcodes can do that. But you can make your own shortcodes.
I suggest you to read shortcodes developer refferance.
I suggest you to read shortcodes developer refferance.
Okay, I'm not good at coding but will try to figure it out sometime. Thanks.qahar wrote:No default shortcodes can do that. But you can make your own shortcodes.
I suggest you to read shortcodes developer refferance.
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.
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
Ie.....
This xyz thing is blah, blah, blah. It is available in: shortcode that represents (shows) options.
Thank you,
Mike
cue4cheap not cheap quality
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.
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.
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
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
You need to parse the shortcodes in journal2 tab description; docs.
Code above only example, you need to ask journal2 dev which part of the theme need to adapt to support Shortcodes ready.
Code: Select all
if (class_exists('Shortcodes') && method_exists($this->shortcodes, 'do_shortcode')) {
$data['j2_tab_content'] = $this->shortcodes->do_shortcode($j2_tab_content);
}
Who is online
Users browsing this forum: No registered users and 112 guests