minadreapta Posted May 18, 2017 Share Posted May 18, 2017 Hello, our SEO guys told us our WHMCS has duplicated content at cart.php. for example: cart.php?a=add&pid=30 has the same content as cart.php?a=add&pid=31 and cart.php?a=add&pid=32 and so on. is there any way we can change that by adding a different little text depending on the pid number? Anyone knows how to achieve this? Thanks. 0 Quote Link to comment Share on other sites More sharing options...
minadreapta Posted May 18, 2017 Author Share Posted May 18, 2017 after searching in the forum i found this: {if $filename eq "cart"} enter some thext here... {else} bla bla here {/if} any ideea how to use this for cart.php and differentiate by product ids? {if $filename eq "cart.php?a=add&pid=30"} text here {elseif $filename eq "cart.php?a=add&pid=31"} another text here {elseif $filename eq "cart.php?a=add&pid=32"} other text here {/if} thanks. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 18, 2017 Share Posted May 18, 2017 untried, but what about something along the lines of... {if $filename eq "cart" and $product.pid eq "30"} text here {elseif $filename eq "cart" and $product.pid eq "31"} another text here {elseif $filename eq "cart" and $product.pid eq "32"} other text here {/if} the correct variable will depend on which step on the cart you're in. 0 Quote Link to comment Share on other sites More sharing options...
minadreapta Posted May 18, 2017 Author Share Posted May 18, 2017 Thanks for the suggestion Brian. it works like this: {if $filename eq "cart" and $pid eq "30"} text here {elseif $filename eq "cart" and $pid eq "31"} another text here {elseif $filename eq "cart" and $pid eq "32"} other text here {/if} - - - Updated - - - now i would like to refine a bit this code. how can i get the product name variable like this: {if $filename eq "cart" and $pid eq "$whatever_the_pid_is"} $product.name here {else} other text {/if} do you know what is the variable for product name? thanks. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 18, 2017 Share Posted May 18, 2017 do you know what is the variable for product name? as I said it will depend where you are in the cart process... quickest solution will be to add {debug} to the template you're working with and get the variable you need from the popup window. 0 Quote Link to comment Share on other sites More sharing options...
minadreapta Posted May 18, 2017 Author Share Posted May 18, 2017 ok, i got the variables i need, i think it's $productinfo.name and $productinfo.description now what i have done looks like this: {if $filename eq "cart" and $pid eq "30"} (Product 30 name - Product 30 description) {elseif $filename eq "cart" and $pid eq "32"} (Product 32 name - Product 33 description) {elseif $filename eq "cart" and $pid eq "33"} (Product 33 name - Product 303 description) ... ... ... {/if} how can i setup the script so it takes the values automatically? like {if $filename eq "cart" and $pid eq "$pid"} ($productinfo.name - $productinfo.description) thanks. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.