Jump to content

SEO for cart.php - duplicate content


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated