I have something pretty weird going on where I'm sure I'm doing something really dumb, but at this point I'll take all help I can get.
Opening url: xxx/order/?type=samples"e=643&decoration=no&quantity=10000&user=16
Note quote is set.
Now I've got this PHP code (it's inside a WordPress page but I don't think that matters):
if (isset($_GET['quote'])) {
$order_id = $_GET['quote'];
$product= get_field('product_link',$order_id);
$no = 1;
} else {
$product=$_GET['product'];
$user = $_GET['user'];
$unit_cost = get_field('10k_base_cost', $product)*(1+(get_field('duties', $product)/100))*(1+(get_field('markup', $product)/100));
$product_moq = get_field('moq', $product);
$product_moq = intval($product_moq);
$site_url = get_site_url();
$url = $site_url."/request-quote/?product=".$product."&decoration_1=0&decoration_2=0&decoration_3=0&decoration_4=0&quantity=".$product_moq."&unit_cost=".urlencode($unit_cost)."&user=".$user."&supress_redirect=1";
$order_id =file_get_contents($url);
}
Now... file_get_contents calls a file that runs some code. Should only be called when quote isn't set. However, it is always ran. Without values (I think) set (i.e. product etc) but still, always ran.
How is beyond me but I'm sure it's obvious. Not a "professional programmer" here :-)
- I've tried to separate it between if XX and if !XXX
- I've tried to make it a CURL requests vs. file_get_contents
Thanks for any pointer in the right direction...
Aucun commentaire:
Enregistrer un commentaire