Post by NedasAndrius » Thu Dec 13, 2018 11:51 pm

Hello, I wanna add item to cart after registration.

I put this code in account/success:
$sql = "INSERT INTO oc_cart (product_id) VALUES ('51')";
if(mysqli_query($link, $sql)){
echo "OK!";
} else{
echo "ERROR $sql. " . mysqli_error($link);
}

Please help me add item to cart after registration.

New member

Posts

Joined
Thu Feb 01, 2018 5:40 am

Post by ocmta » Fri Dec 14, 2018 12:33 am

Edit file catalog/controller/account/register.php, find this line:

Code: Select all

$this->response->redirect($this->url->link('account/success'));
And add this line right above:

Code: Select all

$this->cart->add(51);

Extensions for affiliates (openCart 1, 2, 3):
Advanced Multi Level Affiliate System
Customer and Affiliate Accounts Combined into one Account
Affiliate Tracking with Coupons
Discount for Referred Customers - Order Total
Type Tracking Code
Mass Pay
Affiliate Transactions for openCart 3
Affiliate Pack X - all modules with 40% discount


Active Member

Posts

Joined
Mon Mar 12, 2012 11:21 am


Post by NedasAndrius » Fri Dec 14, 2018 12:36 am

Thank you!

New member

Posts

Joined
Thu Feb 01, 2018 5:40 am
Who is online

Users browsing this forum: No registered users and 86 guests