Last active
November 6, 2018 23:42
-
-
Save AladinDridi/bfbd03bb10b0a52935fda1d1d7255f4e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$product_id=359; | |
$url=''; | |
//check if product already in cart | |
if (WC()->cart->get_cart_contents_count() == 0 ) { | |
WC()->cart->add_to_cart($product_id); | |
wp_redirect($url); | |
exit(); | |
} | |
else{ | |
wp_redirect($url); | |
exit(); | |
} | |
?> | |
<style> | |
h1{ | |
border-radius: | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment