View Single Post
  #6  
Old 10-09-2019, 12:04 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 446
 

Default Re: Checkout Process

I gave up on buttons, instead, I tried
twig file
[code]
{##
#
# @ListChild (list="itemsList.product.grid.customer.tail", weight="99")
#}
<div class="company-logo">
<a href={{ url('cart', 'QuickBuy', { 'param_1': 'some_param_value' }) }}>
Quick Buy</a>
</div>
with Controller class
Code:
public function doActionQuickBuy() { echo "action!"; parent::doActionAdd(); $this->setReturnURL( $this->buildURL('checkout', '', array()) ); }
Then the customer gets redirected to the "checkout page" clicking on the link (provided that the cart is not empty before), but the product isn't added to the cart.
As a matter of fact, if I remove setReturnURL, then nothing happens when the customer clicks on the link. What am I doing wrong here?
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote