Issue with "Subscriptions" link in the HikaShop user control panel

  • Posts: 248
  • Thank you received: 30
  • Hikaserial Subscription Hikashop Business
4 weeks 2 days ago #367889

-- HikaShop version -- : 6.0.0
-- HikaSerial version -- : 5.1.0
-- Joomla version -- : 5.3.0
-- PHP version -- : 8.1.32
-- Browser(s) name and version -- : Google chrome

Hello,
The problem is the same whether SEF is enabled in the global settings or not.
I've encountered an issue with the link to the Subscriptions section in the HikaShop user control panel.
As shown in the attached screenshot, all the links in the user dashboard follow a consistent structure that includes:

/contul-meu/detalii-cont/
For example, the Orders link is correctly generated as:
https://my-domain.ro/contul-meu/detalii-cont/order
Same for each menu option from control panel.

However, the link for the Subscriptions section is currently generated as:
https://my-domain.ro/component/hikashop/subscription/listing
This breaks the navigation and layout of the user control panel.
I tested manually, and if I change the link to:
https://my-domain.ro/contul-meu/detalii-cont/subscription/listing
... everything works as expected, and the user remains within the styled and structured account panel.

The same thing is happening with the renew link for a subscription.
https://my-domain.ro/component/hikashop/subscription/renew/subscription-1/product-2964

Best regards,

Attachments:
Last edit: 4 weeks 2 days ago by oxido.

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
3 weeks 6 days ago #367916

Hello,

The SEF links can be modified by adding the ItemId to the generated URL.
In the view "subscription / listing", you can add " $this->url_itemid " at the end of URL that you want to fix.
I'll see in our end what are the missing URLs and why this behavior now exists.
HikaShop and HikaSerial generally add the current ItemId into the URL if its match to the right menu ; so adding such parameter should be useless.

Regarding the link in the user control panel, that link is added by the HikaShop Serial plugin ; unlike views, you can not override it like that.
But again, the ItemId for the menu is added during the completeLink ; that's why I can't reproduce you issue in our demo website :
demo.hikashop.com/index.php/en/other-fea...s/user-control-panel

Are you using a special SEF plugin?

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.

  • Posts: 248
  • Thank you received: 30
  • Hikaserial Subscription Hikashop Business
3 weeks 4 days ago #367939

On line 46 there is already '$this->url_itemid' at the end of the link, and it exists in several places in the file, but if I var_dump this variable, it has no value: string(0) ""

foreach($this->subscriptions as $subscription) {
$url = hikaserial::completeLink($this->param_prefix.'subscription&task=show&cid='.(int)$subscription->subscription_id.'&name='.$subscription- >pack_name.$this->url_itemid);
?>

No, I don't use any specific plugin for the SEF, just the standard option in joomla and renaming the htaccess.txt file to .htaccess
I use the template Gantry, but that should not be the problem.

Are you suggesting to change that line of code like this? :
$url = hikaserial::completeLink($this->param_prefix.'subscription&task=show&cid='.(int)$subscription->subscription_id.'&name='.$subscription->pack_name.'1825');
Shouldn't it also contain &Itemid=1825?

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
3 weeks 4 days ago #367950

Hello,

The variable " $this->url_itemid " is fill during the display initialization of the view.
That variable contains "&Itemid=..." if the global Joomla variable "$Itemid" contains a value.
If you dump the variable and it was empty, it means that the current URL is not related to a Joomla menu ; otherwise the variable should contains the identifier of the menu.

In order to understand more precisely your issue, we would need more details on the pages which have the issue

Harcoding the menu in your URL is not a recommended solution.
If you change the menu somehow, you will have to re-edit all your views.

But, if you really want to configure the menus ; you can use the HikaShop/HikaSerial configuration system to add your custom entries.
So you can use the "url_itemid" if not empty, or build a " &Itemid=... " based on an HikaShop or HikaSerial config entry ; and you can add several entries for different menus (dependingyour needs).

It would be one possible solution ; even if the best would be to understand why the "Itemid" variable is not set with the current Joomla menu.

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.

  • Posts: 248
  • Thank you received: 30
  • Hikaserial Subscription Hikashop Business
3 weeks 1 day ago #367991

I just installed a brand new J5! with hikashop and Hikaserials, both using the last verions.
I have created a 2 Plans: Silver and Gold
I created 2 products to link the plans to them, each with different price
I created a menu "My subscriptions", linked to Hikaserial > Subscriptions and added this menu as a child of "User control panel", the default menu of Hikashop.
The result is the same, when I click on renew, I end up on home page.
You can see this in my screenshots and you can also test it, I will use the contact form to give you the link to the website and the user&pass to login as Administrator.

Another strange behavior occurred to me when I tried to create the "My subscriptions" menu, because it wouldn't let me make it public until I added a parent menu to it, is this behavior normal?

Attachments:

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
2 weeks 6 days ago #368004

Hello,

I was able to see the issue in our website and I could propose an easy patch but I want to understand exactly why it is now required.
Various tests will be required in order to fully understand your context issue and see what's the best way to handle them.

Regarding your menus issues ; it's a behavior related to Joomla menus.
The "user control panel" is a HikaShop menu ; while the "my subscriptions" is a HikaSerial one.
HikaSerial is faking that its views are HikaShop one ; but when you create a menu in your Joomla backend, its uses XML files and they can't tell they are for another component.
So the menu you create for the subscription is seen as an HikaSerial one and that's a reason why you can have strange behaviors with the routing.

When you write that you're back "at home", it's not that.
It's just that you do not have any menu ID specified in the URL so Joomla indicates that you're under the default menu, which is called "home" in your case.
In fact, it's just menu less URL ; which starts with "index.php/component/...".

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.

  • Posts: 248
  • Thank you received: 30
  • Hikaserial Subscription Hikashop Business
2 weeks 5 days ago #368009

Hi Jerome,

I’m not entirely sure if you were suggesting I should handle menu creation differently, but I’ve managed to check a few things on my end and wanted to share the results:

The issue where I was forced to select a parent menu item has been resolved by selecting all menu items in Joomla and clicking the "Rebuild" button. That fixed the problem entirely.

As for the "Renew" button in the subscriptions section, I was able to make it work by editing the following file:
components/com_hikaserial/views/subscription/tmpl/listing.php.

On line 103, I modified the code from:

$classical_url = 'shop.subscription&task=renew&subscription='.(int)$subscription->subscription_id.'&product='.(int)$renewal['product']->product_id;
to:
$classical_url = 'shop.subscription&task=renew&subscription='.(int)$subscription->subscription_id.'&product='.(int)$renewal['product']->product_id.$this->url_itemid;
This makes the link work correctly only when SEF is disabled in Joomla’s global configuration.
With SEF enabled, however, the link doesn’t function properly anymore.

Could you please clarify if there's a better or recommended approach to generate the correct route for the renew button that also works with SEF enabled?

Thanks in advance!
Best regards,

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
2 weeks 5 days ago #368015

Hello,

The problem with the renewal is not the direct link ; its the redirection which is made after.
I understand that the URL might not be "nice" in some conditions but it's functional and not really visible by the customer.

The "shop_subscription" controllers supposes that you're in a HikaShop context while the "subscription" controllers knows that it must retrieve the HikaShop checkout menu ID.
I think it can be useful to use the same "redirectToCheckout" function in "shop_subscription" controller.
So, when you will renew a subscription, it will add a product into the cart and redirect the user to the checkout URL, based on what is configured in HikaShop (for the default checkout menu).

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.

  • Posts: 248
  • Thank you received: 30
  • Hikaserial Subscription Hikashop Business
2 weeks 5 days ago #368017

Hi Jerome,

Thank you for the explanation. I understand now that the issue is more about the redirection after the renew action, not the link itself.
I will try to implement the behavior the way I believe it should work, by adjusting the logic to keep the proper routing and SEF compatibility.

That said, I’d like to ask if you are planning to release an update for this part of the system in the near future — something that would improve or unify the way the renew process is handled between subscription and shop_subscription contexts.

I just want to know if it makes sense to rely on a future fix from your side or if I should plan to handle it completely on my own.

Thanks again for your support!

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
2 weeks 2 days ago #368035

Hello,

The patch regarding the subscription controller is already pushed on my side ; so it will be include in the next coming release.
And that next release is in preparation, with some new features regarding the PDF Serial plugin.

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.

  • Posts: 248
  • Thank you received: 30
  • Hikaserial Subscription Hikashop Business
2 weeks 2 days ago #368036

Hi Jerome,

That’s great news! I’d actually love to have access to the current patched version, if possible, since I’m right in the middle of implementing something and could really use the fix.

If the next release is coming in 1-2 weeks, I can definitely wait, but if it will take longer, having the updated files now would really help me avoid getting blocked in my project.

I’d truly appreciate it! And I promise, I’ll make sure the company pays for at least another year of subscription for HikaSerial when the time comes :silly:

Best regards!

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

  • Posts: 26264
  • Thank you received: 4043
  • MODERATOR
2 weeks 10 hours ago #368056

Hello,

I just finished validation for the new features in the PDF Serial plugin :
- Font style support (bold, italic, underline)
- Possibility to enable the PDF Protection (against copy/modification)
- Improve QRcode support (can specify/force the width/height)
- "product.field." display a custom field title value (for radio/list/... types) instead of raw value

Which allows me to prepare the new release.

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: oxido

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

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