- Posts: 132
- Thank you received: 3
Ad Button To Ventdor Panel for link+username ??
- alexmartin
-
Topic Author
- Offline
Less
More
12 years 1 month ago #167929
by alexmartin
Ad Button To Ventdor Panel for link+username ?? was created by alexmartin
How to add image to a Vendor Panel and link that image to Vendors directory/ category?
Every vendor user name became his directory. Like
When Mikle Smith registered on the joomla he automatically gets his own directory to store his product inside
mywebsite.com/by/ directory in his folder named after his username Mikle-Smith:
mywebsite.com/by/Mikle%20Smith
or
mywebsite.com/by/Mikle-Smith
So , I guess it is probably possible to add new image in the Vendor Panel that let that vendor see his own store directory.
The link from the image should be: mywebsite.com/by + USER NAME
Question:
1) How to create that link code, or a complete code with image linked to that url
2) Where to place that code to add it to Vendor's Panel and
3) On what line to ad that code please?
Every vendor user name became his directory. Like
When Mikle Smith registered on the joomla he automatically gets his own directory to store his product inside
mywebsite.com/by/ directory in his folder named after his username Mikle-Smith:
mywebsite.com/by/Mikle%20Smith
or
mywebsite.com/by/Mikle-Smith
So , I guess it is probably possible to add new image in the Vendor Panel that let that vendor see his own store directory.
The link from the image should be: mywebsite.com/by + USER NAME
Question:
1) How to create that link code, or a complete code with image linked to that url
2) Where to place that code to add it to Vendor's Panel and
3) On what line to ad that code please?
Please Log in or Create an account to join the conversation.
12 years 1 month ago #167997
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Ad Button To Ventdor Panel for link+username ??
Hi,
You can do it thanks a view override (or a custom plugin).
By overriding the view "frontend | your_frontend_template | vendormarket | cpanel" you can modify the content of the variable "$this->buttons".
The idea is to add a new button in the array.
The other way is to use the trigger
Which allowed you to access and modify the $buttons array, like in the view (but without having to override the cpanel view).
Sample here : www.hikashop.com/support/documentation/1...onVendorPanelDisplay
Regards,
You can do it thanks a view override (or a custom plugin).
By overriding the view "frontend | your_frontend_template | vendormarket | cpanel" you can modify the content of the variable "$this->buttons".
The idea is to add a new button in the array.
Code:
<h2><?php echo $this->vendor->vendor_name; ?></h2>
<?php
//---- Begin a sample code ----
$this->buttons['my_store'] = array(
'url' => hikamarket::completeLink('vendor&task=show&cid='.$this->vendor->vendor_id);
'icon' => 'icon48-mystore',
'name' => JText::_('MY_STORE')
);
//---- End of sample code ----
foreach($this->buttons as $btnName => $btn) {
if(empty($btn))
continue;
The other way is to use the trigger
Code:
onVendorPanelDisplay(&$buttons, &$statistics);
Sample here : www.hikashop.com/support/documentation/1...onVendorPanelDisplay
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- alexmartin
-
Topic Author
- Offline
Less
More
- Posts: 132
- Thank you received: 3
12 years 1 month ago #168055
by alexmartin
Replied by alexmartin on topic Ad Button To Ventdor Panel for link+username ??
Could yo please specify more precise how should I use example line
'url' => hikamarket::completeLink('vendor&task=show&cid='.$this->vendor->vendor_id);
for my url:
mywebsite.com/by
- should it be
' mywebsite.com/by/ ' => hikamarket::completeLink('vendor&task=show&cid='.$this->vendor->vendor_id);
or it should be
From your example:
//---- Begin a sample code ----
$this->buttons = array(
'url' => hikamarket::completeLink('vendor&task=show&cid='.$this->vendor->vendor_id);
'icon' => 'icon48-mystore',
'name' => JText::_('MY_STORE')
);
//---- End of sample code ----
'url' => hikamarket::completeLink('vendor&task=show&cid='.$this->vendor->vendor_id);
for my url:
mywebsite.com/by
- should it be
' mywebsite.com/by/ ' => hikamarket::completeLink('vendor&task=show&cid='.$this->vendor->vendor_id);
or it should be
From your example:
//---- Begin a sample code ----
$this->buttons = array(
'url' => hikamarket::completeLink('vendor&task=show&cid='.$this->vendor->vendor_id);
'icon' => 'icon48-mystore',
'name' => JText::_('MY_STORE')
);
//---- End of sample code ----
Please Log in or Create an account to join the conversation.
12 years 1 month ago #168057
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Ad Button To Ventdor Panel for link+username ??
Hi,
None of them.
"completeLink" is a function which generate you a link (a complete link, with SEF, etc).
If you want to have a nice SEF link, you have to use an "Itemid" and a specific menu (a vendor listing menu is better).
Like :
If HikaShop and HikaMarket are configured to generate SEF and "Remove products and categories id in URLs", you will have a nice SEF url with the name of the vendor.
See : www.hikashop.com/support/support/documen...ig.html#features_sef
Menu edition (work the same in HikaMarket) : www.hikashop.com/support/documentation/i...shop-menus-form.html
More than providing an URL, you have to be sure that the url is working and will display a good content ; that is one of the goals of the function "completeLink".
The code I gave in my previous post is a working code, that you can use directly ; the rest is just to configuration/adjustments.
Regards,
None of them.
"completeLink" is a function which generate you a link (a complete link, with SEF, etc).
If you want to have a nice SEF link, you have to use an "Itemid" and a specific menu (a vendor listing menu is better).
Like :
Code:
$this->buttons = array(
'url' => hikamarket::completeLink('vendor&task=show&cid='.$this->vendor->vendor_id.'&Itemid=42');
'icon' => 'icon48-mystore',
'name' => JText::_('MY_STORE')
);
If HikaShop and HikaMarket are configured to generate SEF and "Remove products and categories id in URLs", you will have a nice SEF url with the name of the vendor.
See : www.hikashop.com/support/support/documen...ig.html#features_sef
Menu edition (work the same in HikaMarket) : www.hikashop.com/support/documentation/i...shop-menus-form.html
More than providing an URL, you have to be sure that the url is working and will display a good content ; that is one of the goals of the function "completeLink".
The code I gave in my previous post is a working code, that you can use directly ; the rest is just to configuration/adjustments.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- alexmartin
-
Topic Author
- Offline
Less
More
- Posts: 132
- Thank you received: 3
12 years 1 month ago #168466
by alexmartin
Replied by alexmartin on topic Ad Button To Ventdor Panel for link+username ??
Thank you Jerome. Thank you for the detailed example.
I added MY STORE icon on the Vendor Page and it works according to your detailed recommendation.
Thank you.
I added MY STORE icon on the Vendor Page and it works according to your detailed recommendation.
Thank you.
Please Log in or Create an account to join the conversation.
- alexmartin
-
Topic Author
- Offline
Less
More
- Posts: 132
- Thank you received: 3
11 years 11 months ago - 11 years 11 months ago #174905
by alexmartin
Replied by alexmartin on topic Ad Button To Ventdor Panel for link+username ??
Ok,
Last edit: 11 years 11 months ago by alexmartin.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #174933
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Ad Button To Ventdor Panel for link+username ??
Hi,
I am sorry but I don't understand your message.
I don't know what button you are talking about, what you are trying to achieve and what is the article.
Regards,
I am sorry but I don't understand your message.
I don't know what button you are talking about, what you are trying to achieve and what is the article.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- alexmartin
-
Topic Author
- Offline
Less
More
- Posts: 132
- Thank you received: 3
11 years 11 months ago - 11 years 11 months ago #175001
by alexmartin
Replied by alexmartin on topic Ad Button To Ventdor Panel for link+username ??
How each vendor gets on to his own directory page
Last edit: 11 years 11 months ago by alexmartin.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #175004
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Ad Button To Ventdor Panel for link+username ??
Hi,
The url type is : index.php?option=com_hikamarket&view=vendor&layout=show&cid=VENDOR_ID&name=VENDOR_NAME
The "name" is optional but it allow to have nice url using the Joomla SEF router.
Otherwise, HikaMarket have some functions to get the vendor_id from another id (like the Joomla user id).
You first need to load the HikaMarket helper and then call the HikaMarket vendor class.
Here a complete code to generate a full and SEF url (with right menu id, etc)
It will see to add a function in the HikaMarket helper in order to generate these url easily.
Regards,
The url type is : index.php?option=com_hikamarket&view=vendor&layout=show&cid=VENDOR_ID&name=VENDOR_NAME
The "name" is optional but it allow to have nice url using the Joomla SEF router.
Otherwise, HikaMarket have some functions to get the vendor_id from another id (like the Joomla user id).
You first need to load the HikaMarket helper and then call the HikaMarket vendor class.
Here a complete code to generate a full and SEF url (with right menu id, etc)
Code:
$joomla_user_id = 0; /* This variable must contain the joomla user id */
// We load HikaMarket is not
if(!defined('HIKAMARKET_COMPONENT')) {
$filename = rtrim(JPATH_ADMINISTRATOR,DS).DS.'components'.DS.'com_hikamarket'.DS.'helpers'.DS.'helper.php';
if(file_exists($filename)) include_once($filename);
}
$vendor_url = ''; /* This variable will contain the link to the vendor page if the vendor exist and his published */
// We check that HikaMarket is right loaded
if(defined('HIKAMARKET_COMPONENT')) {
// We load the vendor based on the joomla user id
$vendorClass = hikamarket::get('class.vendor');
$vendor = $vendorClass->get($joomla_user_id, 'cms');
// We check that the vendor exist and is published
if(!empty($vendor) && !empty($vendor->vendor_published)) {
$app = JFactory::getApplication();
$marketConfig = hikamarket::config();
$stringSafe = (method_exists($app, 'stringURLSafe'));
// Get the vendor alias to have a nice url
$vendor->alias = (empty($vendor->vendor_alias)) ? $vendor->vendor_name : $vendor->vendor_alias;
if($stringSafe) $vendor->alias = $app->stringURLSafe(strip_tags($vendor->alias));
else $vendor->alias = JFilterOutput::stringURLSafe(strip_tags($vendor->alias));
// Get the HikaMarket default menu, to have a nice SEF url
$url_itemid = $marketConfig->get('vendor_default_menu', 0);
if(!empty($url_itemid)) $url_itemid = '&Itemid=' . (int)$url_itemid;
else $url_itemid = '';
// Generate the url
$vendor_url = hikamarket::completeLink('vendor&task=show&cid=' . $vendor->vendor_id . '&name=' . $vendor->alias . $url_itemid);
}
}
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.251 seconds