Link to Akeeba Subscriptions malformed

  • Posts: 36
  • Thank you received: 0
11 years 9 months ago #91075

When the Akeeba subscriptions plugin is installed a new block is created in the "Customer Account" screen. The standard three blocks are:
Customer Account (essentially a re-display of data from the Users table):
http://my-domain/index.php/component/users/profile?layout=edit
Addresses:
http://my-domain/index.php/my-area/hikashop-menu-for-user-control-panel-2/address
Orders:
http://my-domain/index.php/my-area/hikashop-menu-for-user-control-panel-2/order
The new block is:
Subscriptions:
http://my-domain/index.php/my-area/hikashop-menu-for-user-control-panel-2#

The last entry is going nowhere. It ought to point to Akeeba's subscription page:
http://my-domain/index.php/some-menu-item/some-sub-menu-item/subscriptions
... where the meu type is: Akeeba Subscriptions » All of my subscriptions

PS: If Akeeba is installed AFTER Hikashop I don't see how this link can ever be instantiated; the order has to be install Akeeba Subs --> Install Hikashop --> install Akeeba Plugin for Hikashop. The last one has somehow to write the link correctly.

One wonders also if the first two items could be better combined into a single edit screen like the Registration screen? If not then the default wording for the first item "Customer Account" confusingly repeats the main page heading "Customer Account" and would be better described along the lines of "Manage Username/Password"? or simply "Edit User Account".

Where can I hack these strings and repair link #4?

Ric

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #91132

Hi,

I just installed Akeeba Subs after HikaShop and installed the plugin.
On my end the link is working fine.

Are the subscriptions working ? Is the plugin between Akeeba and HikaShop well activated ?

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

  • Posts: 36
  • Thank you received: 0
11 years 9 months ago #91168

Hello Xavier, yes. The plugin is installed and Hikashop passes data through to Akeeba as expected. On confirmation of order the subscription period is initiated. If I cancel an order the subscription period ends (highlighted pink in Akeeba Subs. If I re-enable the order, once again the subscription period is reinstated.

In fact the two components are working very well together in this respect - though with a lot of transactions, matching Hikashop orders to Akeeba subscriptions can be challenging.

This is the 2nd installation of the two components. Later this evening I'll try resinstalling akeeba subs and the plugin just to see if that has any effect.

THanks for helping,
Ric

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #91183

You can try to edit the view "user / cpanel" and in the foreach add a if like:

if($oneButton['text'] == 'Subscriptions'){
    $url = JURI::base().'/index.php?option=com_akeebasubs&view=subscriptions';
}else
{
    // original url
}

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

  • Posts: 36
  • Thank you received: 0
11 years 9 months ago #91398

Hello again,

First, I probably did not edit the file correctly, but I have had no success in getting the control panel to work. Your suggestion may be correct - but I found myself spending too long editing and testing a file that will be overwritten at upgrade. In the end I took a workaround solution by not using cpanel but using individual menu items to achieve the same goals.

Thanks Xavier for your input.

Regards,
Ric

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
11 years 9 months ago #91510

Hi,

I'm glad you found a solution which works for you.

Please note that if you edit the file user/cpanel (or any other one) via the menu Display->Views you don't loose your changes when updating as the modifications are stored as template overrides.

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

  • Posts: 36
  • Thank you received: 0
11 years 8 months ago #92674

Hello again,

I have kinda painted myself into a corner here.

Up till now registration has been through the process of adding products to a cart and forcing the new user to enter name, address etc. So far so good. I now find there are certain documents I do not want to be visible to non-registered users. I do not want to register users using the default Joomla interface otherwise new users can bypass name, address, etc that Hikashop neatly requests.

To make this work I activated the plugin to redirect Joomla Registration to Hikashop registration and that works fine. However, when I click "the "registration" menu option and the user is already logged in that user is returned to the cpanel (something I had carefully avaioded using separate menu items).

I have finally found the correct syntax for the mod Xavier suggested:

<div class="hikashopcpanel" id="hikashopcpanel">
    <?php
    foreach($this->buttons as $oneButton){
    
    if($oneButton['text'] == 'Subscriptions'){
    $url = JURI::base().'/index.php?option=com_akeebasubs&view=subscriptions';
}else
{
    $url = hikashop_level($oneButton['level']) ? 'onclick="document.location.href=\''.$oneButton['link'].'\';"' : '';
} ?>
    
      
      <div <?php echo $url; ?> class="icon hikashop_cpanel_icon_div">

I even changed the path to match exactly the URL obtained through a direct menu link:


<div class="hikashopcpanel" id="hikashopcpanel">
    <?php
    foreach($this->buttons as $oneButton){
    
    if($oneButton['text'] == 'Subscriptions'){
    $url = JURI::base().'/my-account/my-subscriptions/subscriptions'; <<=== this line changed
}else
{
    $url = hikashop_level($oneButton['level']) ? 'onclick="document.location.href=\''.$oneButton['link'].'\';"' : '';
} ?>
    
      
      <div <?php echo $url; ?> class="icon hikashop_cpanel_icon_div">

Irrespective of which URL completion string is used the result in the cpanel link is always:

http://<some-domain>/index.php/component/hikashop/user/cpanel#


Is there a reason why the override is not being picked up (or rather a reason why the default is overriding the changes above?)

Or alternatively, redirect the logged-in user away from cpanel to some innocent page after choosing registration?

Thanks,
Ric

Last edit: 11 years 8 months ago by ricm.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 8 months ago #92820

Hi,

It should work with this code:

			if($oneButton['text'] == 'Subscriptions')
				$oneButton['link'] = JURI::base().'/index.php?option=com_akeebasubs&view=subscriptions';

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

  • Posts: 36
  • Thank you received: 0
11 years 8 months ago #92847

I'm afraid it doesn't work - the results are as before:

http://some-domain/index.php/component/hikashop/user/cpanel#


The change of URL does not affect the <a> link within the outer div:
<div onclick="document.location.href='/some-domain/index.php/component/hikashop/order';" class="icon hikashop_cpanel_icon_div">

The link is here on the next line:
<a href="#">
          <table class="hikashop_cpanel_icon_table">
            <tr>

As you can see, this is the source of the null ending on the URL. It also looks as though the javascript onclick event isn't triggered.
My workaround (whilst keeping the cpanel) has been to hard-code the table so that the 4th entry (for subscriptions) looks like this:
    <div  class="icon hikashop_cpanel_icon_div">
      <a href="/some-domain/index.php?option=com_akeebasubs&view=subscriptions">
        <table class="hikashop_cpanel_icon_table">
          <tr>
            <td class="hikashop_cpanel_icon_image">
              <span class="hikashop_cpanel_icon_image_span icon-48-subscription" title="Subscriptions"> </span>
              <span class="hikashop_cpanel_button_text">Subscriptions</span>
            </td>
            <td>
              <div class="hikashop_cpanel_button_description">
                <ul><li>Show my subscriptions</li></ul>
              </div>
            </td>
          </tr>
        </table>
      </a>
    </div>

Not very versatile I know (it breaks with akeeba backup when transferring to a different site) but it does the job.

Ric

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

Time to create page: 0.072 seconds
Powered by Kunena Forum