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.
Edit file catalog/controller/account/register.php, find this line:And add this line right above:
Code: Select all
$this->response->redirect($this->url->link('account/success'));
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