How to solve orders id problem

treewood (OpenSolution)

Avatar: treewood

2007-12-31 13:44

Following solution deal with problem of strange order numbers in database. It can be caused by robots (ex. google etc.), which are clicking on links as "add to basket" link in products list. It can damage "db/orders.php" and "db/orders_products.php" files. Following steps are tested in Quick.Cart v2.2. If You have v1.x then You must search for link to basket in templates/products_list.tpl.

1. in file templates/products_list.tpl find code:

<a href="?p=ordersBasket&amp;sOption=add&amp;iProduct=$aList[iProduct]&amp;iQuantity=1" class="basket" title="$lang[Add_to_basket]">$lang[Add_to_basket]</a><a href="?p=ordersBasket&amp;sOption=add&amp;iProduct=$aList[iProduct]&amp;iQuantity=1" class="price" title="$lang[Add_to_basket]">

and replace it with following:

<a href="?p=ordersBasket&amp;sOption=add&amp;iProduct=$aList[iProduct]&amp;iQuantity=1" class="basket" title="$lang[Add_to_basket]" rel="nofollow">$lang[Add_to_basket]</a><a href="?p=ordersBasket&amp;sOption=add&amp;iProduct=$aList[iProduct]&amp;iQuantity=1" class="price" title="$lang[Add_to_basket]" rel="nofollow">

Unfortunately some robots ignore rel="nofollow", so if you still have problem despite making modyfication from step 1. you should use more restrictive solution:

2. In file templates/products_list.tpl find following code:

<a href="?p=ordersBasket&amp;sOption=add&amp;iProduct=$aList[iProduct]&amp;iQuantity=1" class="basket" title="$lang[Add_to_basket]" rel="nofollow">$lang[Add_to_basket]</a><a href="?p=ordersBasket&amp;sOption=add&amp;iProduct=$aList[iProduct]&amp;iQuantity=1" class="price" title="$lang[Add_to_basket]" rel="nofollow">

Change this code for the following:

<form action="" method="get" class="basket">
  <
fieldset>
    <
input type="hidden" name="p" value="ordersBasket" />
    <
input type="hidden" name="sOption" value="add" />
    <
input type="hidden" name="iProduct" value="$aList[iProduct]" />
    <
input type="hidden" name="iQuantity" value="1" />
    <
em><input type="submit" value="$lang[Add_to_basket]" class="submit" /></em>
  </
fieldset>
</
form>
<
div class="price"><em>$lang[Price]:</em><span>$aList[sPrice]</span>$config[currency_symbol]</div>

This modyfication change link to form. Now you need to customise its design by style modyfication.

Back to top
about us | contact