OPENCART MODULE :
Opencart Compare Link Link your compared product to forum/email
Frontend Link From Admin Dashboard Get link to product , category, manufacturer, information from admin backend.
Copy and DIRECTLY Edit Product the easy way.
Custom Product Sort Full control to product sorting options
Already Sold Product Module, shows total product sold
OPENCART MODULE :
Opencart Compare Link Link your compared product to forum/email
Frontend Link From Admin Dashboard Get link to product , category, manufacturer, information from admin backend.
Copy and DIRECTLY Edit Product the easy way.
Custom Product Sort Full control to product sorting options
Already Sold Product Module, shows total product sold
Code: Select all
/**
* Generate brand/ manufacturer link.
*
* [link_brand ssl="0" title="xyz" /]
* [link_brand ssl="1" title="xyz"]custom text[/link_brand]
*
* [link_brand brand="x" ssl="0" title="xyz" /]
* [link_brand brand="x" ssl="1" title="xyz"]custom text[/link_brand]
*/
function link_brand($atts, $content = '') {
extract(shortcode_atts(array(
'brand' => 0,
'ssl' => 0,
'title' => ''
), $atts));
$ssl = ($ssl) ? "'SSL'" : "";
$title = ($title) ? 'Title="' . $title . '"' : "";
$this->load->model('catalog/manufacturer');
$manufacturer = $this->model_catalog_manufacturer->getManufacturer($brand);
if ($manufacturer) {
//version check
$suffix = 'info';
if (version_compare(VERSION, '1.5.3.1', '<=') == true) {
$suffix ='product';
}
if (!$content) {
$this->load->language('product/manufacturer');
if (!$brand) {
return '<a href="' . $this->url->link('product/manufacturer', '', $ssl) . '" ' . $title . '>' . $this->language->get('text_brand') . '</a>';
} else {
return '<a href="' . $this->url->link('product/manufacturer/'.$suffix, 'manufacturer_id=' . $brand, $ssl) . '" ' . $title . '>' . $manufacturer['name'] . '</a>';
}
} elseif ($content) {
if (!$brand) {
return '<a href="' . $this->url->link('product/manufacturer', 'manufacturer_id=' . $brand, $ssl) . '" ' . $title . '>' . $content . '</a>';
} else {
return '<a href="' . $this->url->link('product/manufacturer/'.$suffix, 'manufacturer_id=' . $brand, $ssl) . '" ' . $title . '>' . $content . '</a>';
}
}
} elseif (!$manufacturer && $content) {
return $content;
}
}
OPENCART MODULE :
Opencart Compare Link Link your compared product to forum/email
Frontend Link From Admin Dashboard Get link to product , category, manufacturer, information from admin backend.
Copy and DIRECTLY Edit Product the easy way.
Custom Product Sort Full control to product sorting options
Already Sold Product Module, shows total product sold
Code: Select all
/**
* Embed Image
* @example [img title="helllo world" width=100 height=200]http://example.com/cool_image.jpg[/img]
**/
function img( $atts , $content = null ) {
// Attributes
extract( shortcode_atts(
array(
'width' => '',
'height' => '',
'title' => '',
), $atts )
);
// Code
return '<img src="' . $content . '" width="' . $width . '" height="' . $height . '" alt="'.$title.'" title="'.$title.'">';
}
OPENCART MODULE :
Opencart Compare Link Link your compared product to forum/email
Frontend Link From Admin Dashboard Get link to product , category, manufacturer, information from admin backend.
Copy and DIRECTLY Edit Product the easy way.
Custom Product Sort Full control to product sorting options
Already Sold Product Module, shows total product sold
For themes, we can create folder include/ then use include_once() inside shortcodes.phprempong wrote:For wider usage, maybe it need to have custom folder, ex:shortcodes. The program then scan that folder for shortcode function(s). Because if any added shortcode has to put in "shortcodes.php", it will be fat, and not efficent
But for extensions, I'm not decide the final approach. One of the plan is to to use catalog/shortcodes/ folder to populate shortcodes for extensions.
One thing I can sure is the sequent of shortcode is default, extensions then themes. Themes will able to overwrite default and extensions shortcodes.
Will check the manufacturer link and add the image to default shortcodes
* Fixed
^ Improvements
+ New Feature
~ Deprecated
v.1.0-RC.3
^ Rewrite shortcodes API to OO approach
^ Move default shortcodes from library to helper
^ Strip shortcode on user input: review, shipping n payment comment and return details
+ Image shortcodes
+ Global shortcode folder for extensions shortcodes
Actually I'm not really understand your question.butte wrote:Since it went by above and there's been shift in usages generally . . . include once or require once?
I'm expecting an error when require is fail to include the file.
In the link #45 speaks to that. "My suggestion is to just use require_once 99.9% of the time." In the note below there, "The key points are that the include family are usually an outright bad idea (because it's pretty rare to be including files that have any possibility of not existing), and that out of require_once and require, you should use require_once when including files that define functions or classes to be used elsewhere, or instantiate singletons like database connection objects, and use require for including files that immediately do stuff when they get included. In any large web application, the latter kind of include is unusual."
Practicalities are few, essentially just variants along these lines. At #3, "With require the file must exist, if it doesn't then an error will display; whereas with include - if the file doesn't exist then then the page will continue loading." At #2, "Use require_once to load dependencies (classes, functions, constants). Use require to load template-like files."
i just installed it and unfortunatly i got this error :
Fatal error: Call to a member function do_shortcode() on a non-object in /home/dorba468/public_html/opencart/vqmod/vqcache/vq2-system_engine_controller.php on line 124
i guess it's because i'm using seo mega pack pro, since i saw in the vqmod file it's looking for something in seo_url...
i should change something in the xml file ?
any ideas ? thanks !
www.musicincloud.com - Royalty Free Music
www.lapalinka.com - Gypsy Jazz
From the error I can say that the $this->shortcodes not available at OpenCart registry.
And this happen (most possibly) because seo mega pack force opencart not to load common/seo_url.php and use their own seo file.
I suggest you to copy part of Shortcodes xml into seo mega pack.
Since I don't have seo mega pack, I cannot suggest what file you need to modificate or where you need to put them.
I hope you get the idea why it's not work
Ingat Gadget, Ingat DroidLime https://www.droidlime.com/
Super!
Ernie
can be seen here:
http://www.bigmax.ch/shop/index.php?rou ... ation_id=8
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
I'd like to know if I can embed information page content instead of link.
For example, I used this code to insert text from one page into all product descriptions.
Code: Select all
// TODO:Add page text
// $this->load->model('catalog/information');
// $information_info = $this->model_catalog_information->getInformation(20);
// $infotext = html_entity_decode($information_info['description'], ENT_QUOTES, 'UTF-8');
// ?>
// <?php // echo $infotext; ?>
Will it be possible someday?
Because OpenCart shortcodes is a "plugin" to help developer to provide Shortcodes for end user.
You can create your own shortcodes tags, for complete refference read the Shortcodes Developer Guide.
For the quick, create file shortcodes_custom.php and put it at catalog/view/theme/your_active_theme/
The content of the file
Code: Select all
class ShortcodesCustom extends Controller {
function info_content($atts) {
extract($this->shortcodes->shortcode_atts(array(
'id' => '',
), $atts));
if ($id) {
$this->load->model('catalog/information');
$information_info = $this->model_catalog_information->getInformation($id);
$infotext = html_entity_decode($information_info['description'], ENT_QUOTES, 'UTF-8');
return $infotext;
}
}
}
Code: Select all
[info_content id="20" /]
Users browsing this forum: No registered users and 1 guest