After "Cancel" button clicks, redirect to a defined hikashop product menu item.

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
6 years 1 month ago #288282

-- HikaShop version -- : 3.3.0
-- HikaMarket version -- : 2.0.1
-- Joomla version -- : 3.8.2

Hi,

I have a little question regarding the working of the "Edit" button that links a frontend Hikashop Product view with the Hikamarket frontend product editor.

I'm on the Hikamarket frontend product editor (after clicking the edit button from the hikashop product view),

with this parameter on the url: "cancel_action-product".

This parameter causes to redirect to the Hikashop product view (that's correct).

But, when I click on the "Cancel" ("Cancelar" in my spanish version) button on Hikamarket:



It redirects to this URL:

..."component/hikashop/product/2158-duplicate_product_PROVA2"

That's correct, but...

The problem this is not the "menu item" URL I have defined for product views.

It's possible to force the redirect to go to one concrete menu item?

If it's possible, how can I do it?

I don't know how to do it.

Thanks in advance.

--
Victor

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 1 month ago #288311

Hello,

In the file "components/com_hikamarket/views/productmarket/view.html.php" you can see to replace

if(!empty($product->product_id))
	$this->toolbar['cancel']['url'] = hikamarket::completeLink('shop.product&task=show&cid='.$product->product_id);
By
if(!empty($product->product_id)) {
	$shopProductClass = hikamarket::get('shop.class.product');
	$productClass->addAlias($product);
	$this->toolbar['cancel']['url'] = hikashop_contentLink('product&task=show&cid=' . (int)$product->product_id . '&name=' . $product->alias, $product);
}
In order to use the HikaShop content link function which should generate a more friendly URL for the users.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: PeterChain

Please Log in or Create an account to join the conversation.

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
6 years 1 month ago #288358

Hi, thanks for the answer.

I slightly modified the code you provided to make it redirect to the menu item I wanted, so now it's perfect.

There's some way something like this will be an option in future releases (just to not having to override it again next time I update the component)?

By the way, here's the code modified, just in same somebody needs it:

$shopProductClass = hikamarket::get('shop.class.product');
$shopProductClass->addAlias($product);
$this->toolbar['cancel']['url'] = hikashop_contentLink('product&task=show&cid=' . (int)$product->product_id . '&name=' . $product->alias . "&Itemid=[menu item id]", $product);

Thanks again.

--
Victor

Last edit: 6 years 1 month ago by PeterChain.

Please Log in or Create an account to join the conversation.

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
6 years 1 month ago #288392

Hello,

No, it cannot be converted into an option since a single "item id" do not define an entire store for the product links.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.067 seconds
Powered by Kunena Forum