Author Topic: Template overrides ONLY from default template?  (Read 926 times)

bryanearl

  • Beginner
  • *
  • Posts: 44
  • Web Design and SEO / SMO
    • Bryan Earl Web Design
Template overrides ONLY from default template?
« on: April 25, 2019, 16:57:35 pm »
Virtuemart 3.4.2
Joomla 3.9.5


I have two different templates installed in Joomla. My default template is used for most pages, and has many virtuemart override files (such as padded.php in the /cart folder).

I also have a secondary template that is used for multiple specific pages. For only those pages using the secondary template, I am trying to change the "show cart" URL link in the top-right of the popup after adding a product to the cart. Therefore, I added the override for the padded.php file (same as I did for the default template) but it refuses to use it, even when the user is on the page with the secondary template.

It seems that no matter what, it keeps pulling the override file from the default template.

How can I make it use overrides from the ACTIVE template, rather than always from the default template, even when it's not being used?

OR, if I cannot make it use all overrides from a secondary template, how can I make this specific change to the padding.php file while ONLY on the page with the active secondary template? Any way I can force that code change?

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2587
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Template overrides ONLY from default template?
« Reply #1 on: April 25, 2019, 20:00:58 pm »
Have You assigned the cart to a menu item ? Have You assigned the template to this menu item ?

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

bryanearl

  • Beginner
  • *
  • Posts: 44
  • Web Design and SEO / SMO
    • Bryan Earl Web Design
Re: Template overrides ONLY from default template?
« Reply #2 on: April 25, 2019, 20:21:01 pm »
Have You assigned the cart to a menu item ? Have You assigned the template to this menu item ?

Jörgen @ Kreativ Fotografi

Yes, assigned and verified. Still pulls virtuemart related overrides from the "default template" only, even if the active template is my secondary one. All other overrides are working from the secondary template, except virtuemart related.

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2587
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Template overrides ONLY from default template?
« Reply #3 on: April 25, 2019, 23:24:12 pm »
No Virtuemart override works at all ?

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

bryanearl

  • Beginner
  • *
  • Posts: 44
  • Web Design and SEO / SMO
    • Bryan Earl Web Design
Re: Template overrides ONLY from default template?
« Reply #4 on: April 25, 2019, 23:44:26 pm »
No Virtuemart override works at all ?

Jörgen @ Kreativ Fotografi

Correct. I have been reading up on it and this appears to be standard for virtuemart and I have read many threads here in the forum about it. I just need that one file (/cart/padded.php)to override for my secondary template... I can do without the rest. Any idea how I can force an override via code injection or a head script or something in the active template?

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2587
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Template overrides ONLY from default template?
« Reply #5 on: April 26, 2019, 06:41:47 am »
Hello, this is simply non sense. Assigning a different template to a menu item works as expected. How do you assign the other template? What item id do you get in the url.  Are you using some kind of sef extensions ?

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

bryanearl

  • Beginner
  • *
  • Posts: 44
  • Web Design and SEO / SMO
    • Bryan Earl Web Design
Re: Template overrides ONLY from default template?
« Reply #6 on: April 26, 2019, 16:15:32 pm »
Hello, this is simply non sense. Assigning a different template to a menu item works as expected. How do you assign the other template? What item id do you get in the url.  Are you using some kind of sef extensions ?

Jörgen @ Kreativ Fotografi

Apparently you don't understand what I am saying. Assigning a different template to a menu item works perfectly, just as every other Joomla site. The issue is that the override for com_virtuemart/cart/padded.php DOES NOT WORK FROM A SECONDARY TEMPLATE. It pulls that override from the DEFAULT TEMPLATE, even if the ACTIVE TEMPLATE is the secondary.

The secondary template is assigned via the menu item. No SEF extensions are used. I verified this exact behavior with a fresh site, installing two templates, having that file mentioned above overriden in both templates, but no matter what, it ALWAYS pulls the override from whatever template is marked as the default.

Jörgen

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2587
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Template overrides ONLY from default template?
« Reply #7 on: April 26, 2019, 20:41:09 pm »
I see but I tried to get some hints
Quote
No Virtuemart override works at all ?

Jörgen @ Kreativ Fotografi

Will take a closer look.

Jörgen @ Kreativ Fotografi
Joomla 3.9.8
Virtuemart 3.4.x
Olympiantheme Hera (customized)

bryanearl

  • Beginner
  • *
  • Posts: 44
  • Web Design and SEO / SMO
    • Bryan Earl Web Design
Re: Template overrides ONLY from default template?
« Reply #8 on: April 29, 2019, 17:20:37 pm »
I resolved my issue by making extra code changes in the padded.php file (on my default template) to perform an IF statement:

- IF the current page is /XXXXX then make the "show cart" button URL /XXXXX
- ELSE make the "show cart" button URL /XXXXX

... so for the moment, I have a functioning workaround because the page in question can only be accessed by a user that is part of a particular group.