Change layout of pricing table, show categories

  • Rusty
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 months 3 weeks ago #164418 by Rusty
I need to change the way the pricing table is showing current membership available.

I am using an override for the 'pricingtablecircle' layout here:  dev.barges.org/index.php?option=com_osme...cle&id=0&Itemid=1689

I need the layout to look like this:

 

I have categories as follows:

Single Memberships
     - UK & Europe
     - Rest of World

Family Memberships
     - UK & Europe
     - Rest of World

and then plans accordingly within those categories. 

I need to know if I can output the category name in the frontend (and if so, how). I can then potentially group them based on their category.

Thanks

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

More
2 months 3 weeks ago #164423 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Change layout of pricing table, show categories
Hi Justy

You will need to modify code in the layout file components/com_osmembership/view/common/tmpl/pricingtable_circle_plans.php to change it to meet your need

The category data is not available there, so you will need to query database. For example:
Code:
if ($item->category_id > 0) { $category = OSMembershipHelperDatabase::getCategory($item->category_id); echo $category->title; }

Regards,

Tuan

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

More
2 months 3 weeks ago #164424 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Change layout of pricing table, show categories
Keep in mind that all the changes should be implemented using override, so you need to move that modified file to templates/template_name/html/com_osmembership/common folder so that the change won't be lost when you update to future releases of the extension

Regards,

Tuan

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

  • Rusty
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 months 3 weeks ago - 2 months 3 weeks ago #164425 by Rusty
Thanks, yes I've got them as overrides.

I've updated "html/com_osmembership/common/pricingtable_circle_plans.php", presumably I then need to update the code in "html/com_osmembership/plans/pricingtablecircle.php" ?
Last edit: 2 months 3 weeks ago by Rusty.

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

More
2 months 3 weeks ago #164426 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Change layout of pricing table, show categories
It's up to you. But I don't think change to html/com_osmembership/plans/pricingtablecircle.php is needed. Not sure what you want to change/add to that file?

Tuan

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

  • Rusty
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 months 2 weeks ago #164499 by Rusty
Thanks again, this is nearly working, your code is outputting the category, but I also have a parent category that I need to group them by.

The categories are as follows:

Single Memberships
- UK & Europe
- Rest of World

Family Memberships
- UK & Europe
- Rest of World

So I want to group by

First Category (first) and then second category.

Hope that makes sense. How could I do this please?

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

More
2 months 2 weeks ago #164514 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Change layout of pricing table, show categories
Sorry but I still don't know exactly how you want to change it. If it is just output some additional information, I can guide you with basic code. But if you want to change layout structure, I'm afraid of you will need to have a developer to help you

Regards,

Tuan

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