Skip to Content

New J2Commerce 6.6.5 is out. Here is everything in the release.

See What’s New
Account
Enter the email address on your account.
Forgot your username?
Enter your password.
Forgot your password?

Or continue with

Closed Public Category: Technical Support / Bugs Ticket #1116

Need help with a client updates

This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

J2Commerce

Version
J2Store/J2Commerce v4

Conversation

Daniel Bronstein
below are the updates I need someone to do for me, I already did some but here  are the ones I don't know how to do. https://stilokickz.com

 

⚠ Template Override Token protection

The following template override files appear to be missing token protection. Update these files manually.
Note: You may not find a place to insert the missing code if your overrides differ significantly from the original files, and you may not need to add it at all.

In the following file(s), append &<?php echo JSession::getFormToken(); ?>=1 to the hardcoded order-placement AJAX query string:

data: 'option=com_j2store&view=checkout&task=confirm&<?php echo JSession::getFormToken(); ?>=1'
  • templates/bella_pro/html/com_j2store/checkout/default.php

In the following file(s), add JSession::getFormToken() => '1' to the getCartUrl function.

$platform->getCartUrl(array(JSession::getFormToken() => '1', ...
  • templates/bella_pro/html/com_j2store/carts/default.php
  • templates/bella_pro/html/com_j2store/carts/default_items.php
  • templates/bella_pro/html/mod_j2store_cart/detailcartonhover.php

In the following file(s), add data-<?php echo JSession::getFormToken(); ?>="1" as an attribute on the link with class j2store_add_to_cart_button:

<a class="... j2store_add_to_cart_button" data-<?php echo JSession::getFormToken(); ?>="1">...</a>
  • templates/bella_pro/html/com_j2store/templates/uikit3/cart.php

After updating, clear the Joomla cache, if enabled.

Olivier Buisard Staff

No problem Daniel,

I can do them for you.

Olivier.

Olivier Buisard Staff

I left one remaining item, but it is a false positive.

Olivier.

Daniel Bronstein

Thank you Oliver

I still has an issue if there is somthing in the cart you want to delete you get this 

The most recent request was denied because it had an invalid security token. Please refresh the page and try again.

 

In the following file(s), add data-<?php echo JSession::getFormToken(); ?>="1" as an attribute on the link with class j2store_add_to_cart_button:

<a class="... j2store_add_to_cart_button" data-<?php echo JSession::getFormToken(); ?>="1">...</a>
  • templates/bella_pro/html/com_j2store/templates/uikit3/cart.php

After updating, clear the Joomla cache, if enabled.

I looked at the file and didn't see this new update, I did see I can checkout since you did the others

 

here is the actual cart.php

<?php
/**
* @package J2Store
* @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org
* @license GNU GPL v3 or later
*/

// No direct access
defined('_JEXEC') or die;

$product = $this->singleton_product;
$params = $this->singleton_params;
$action = 'index.php?option=com_j2store&view=carts&task=addItem&product_id='.$product->j2store_product_id;
?>
<?php echo J2Store::plugin()->eventWithHtml('BeforeAddToCartButton', array($product, J2Store::utilities()->getContext('cart'))); ?>
<div class="cart-action-complete" style="display:none;">
<p class="text-success">
<?php echo JText::_('J2STORE_ITEM_ADDED_TO_CART');?>
<a href="https://www.j2commerce.com/<?php echo $product->checkout_link; ?>" class="j2store-checkout-link">
<?php echo JText::_('J2STORE_CHECKOUT'); ?>
</a>
</p>
</div>
<a class="<?php echo $params->get('addtocart_button_class', 'uk-button uk-button-primary');?> j2store_add_to_cart_button"
href="https://www.j2commerce.com/<?php echo JRoute::_($action); ?>" data-quantity="1" data-product_id="<?php echo $product->j2store_product_id;?>"
rel="nofollow">
<?php echo $this->singleton_cartext; ?>
</a>
<?php echo J2Store::plugin()->eventWithHtml('AfterAddToCartButton', array($product, J2Store::utilities()->getContext('cart'))); ?>

thank you so,

stilokickz.com

Daniel 

Olivier Buisard Staff

Thanks for the credentials Daniel.

I corrected the couple places where the token was missing or improperly set.

You can now delete an item or empty the cart.

Olivier.

Olivier Buisard Staff

As per our email conversations, I am closing this ticket.

Olivier.