Author Topic: template override of cart not possible? (padded.php)  (Read 1494 times)

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
template override of cart not possible? (padded.php)
« on: December 27, 2015, 18:51:40 pm »
Hi
im trying to make  a template override.
Somehow the continue_link is giving me something different in v. 3.0.12 than it used to do.

This means that either i have to figure out WHY or i make a template override of the fancybox text that shows up after you add an item to cart.

what i wanted to do is make a file
templates/template_name/html/com_virtuemart/cart/padded.php

Can someone confirm this issue? and is it intentional?

Using joomla 3.4.8

btw
The old continue_link used to give me a self link (link to same page but reload)

The new gives me a link to category, which i dont understand why.

Thanks

best regards
Wel

Best regards,
Wel

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9143
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: template override of cart not possible? (padded.php)
« Reply #1 on: December 27, 2015, 21:20:47 pm »
afaik the continue link went non sef around 3.0.11.x because of lang detection problems with J3.. there is a number of posts about this from memory
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: template override of cart not possible? (padded.php)
« Reply #2 on: December 28, 2015, 15:01:58 pm »
OKay i forgot to mention that live site runs 3.0.10 and testsite runs 3.0.12 where i spottet the problem. ill try to see if i can find any posts
Best regards,
Wel

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: template override of cart not possible? (padded.php)
« Reply #3 on: December 28, 2015, 15:19:54 pm »
Okay so my first "hit" was Milbo's response:
http://forum.virtuemart.net/index.php?topic=131871.msg457005#msg457005
So this explains why there is a change to the continue_link. now..

This does not explain why padded.php is not able to template override which is what i actually want. Because i want the continue link to be a fixed link (redirect to self)

This guy:
http://forum.virtuemart.net/index.php?topic=131473.msg453466#msg453466

Seems to also have a problem with this.

Best regards,
Wel

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4023
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: template override of cart not possible? (padded.php)
« Reply #4 on: December 28, 2015, 17:07:44 pm »
Have you try in padded.php to change $this->continue_link with
Code: [Select]
$virtuemart_category_id = shopFunctionsF::getLastVisitedCategoryId ();
if($virtuemart_category_id) {
$this->continue_link = jroute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $virtuemart_category_id );
} else $this->continue_link = jroute::_('index.php?option=com_virtuemart');
and
Code: [Select]
$this->cart_link= jroute::_('index.php?option=com_virtuemart&view=cart');
Note: i don't have test this code.

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: template override of cart not possible? (padded.php)
« Reply #5 on: December 28, 2015, 19:32:45 pm »
No i have not. but this isent "my" real issue. The issue is that i cannot make template override. So the problem that arise during some change in continue_link is not of interest for me.
Doing changes to core files is also not of any interest. i have a document of core hacks and this document must be kept to a minimum. :)
And for me it seems like its a error that padded.php cannot be overridden.
My problem however is that i dont know how to solve it, and therefore cannot suggest it.
Best regards,
Wel

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4023
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: template override of cart not possible? (padded.php)
« Reply #6 on: December 28, 2015, 22:28:03 pm »
How you know that you cannot overide it ?
I Checked the code and this use template overide. But perhaps your template do not use same layout, because you use a framework or a plugin ?
Try to use default template protostar and do an overide in this template and check if it work. I'm pretty sure you have no problem with it.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9143
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.4.2
Re: template override of cart not possible? (padded.php)
« Reply #7 on: December 28, 2015, 22:33:44 pm »
and i have over ridden padded.php without problems on sites
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: template override of cart not possible? (padded.php)
« Reply #8 on: December 29, 2015, 10:57:02 am »
SO i tried installing vmbeez5 (the standard protostar didnt show any popup) and i tried to add to cart, but i just end in the cart with the items added.

In configuration -> templates -> Activate CSS & Javascript
i have everything checked else than jQuery in dropdown.

Without the popup working i cant test if padded.php can be overriden.
Best regards,
Wel

welrachid

  • Jr. Member
  • **
  • Posts: 260
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: template override of cart not possible? (padded.php)
« Reply #9 on: December 30, 2015, 00:22:12 am »
I found the issue.
It was with my jquery .get link that had an format=json that caused this wierd error.

removing that solved it.

thanks for you time.
Best regards,
Wel

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4023
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: template override of cart not possible? (padded.php)
« Reply #10 on: December 30, 2015, 00:42:38 am »
Another problem can be the missing "json" format in the ajax call.
eg.
Code: [Select]
$.post( URL_to_call,  function( data ) {
  //my code
});
changed to

Code: [Select]
$.post( URL_to_call,  function( data ) {
  //my code
}, "json");
have solve some error i had in some browser.