You will be forever remembered for the work you have done and the help you have given to so many...
Duncan Rounding
Norman Rouxel very sadly passed away on Monday the 1st of May 2023 after struggling with cancer for the previous two years. His contribution to Sellerdeck users 'has been immeasurable' (Bruce Townsend).
On 29 March 2023 Norman posted the latest V16 and V18 versions of his Sellerdeck and Actinic E-Commerce, extensions, add-ons and plugins (including many never published). He also published an earlier Add-Ons file containing nearly everything he had done up to around 2020. It was his wish that these files be put somewhere that others can find it so I am posting them here.
Grateful to Lee Phillips of
www.mdnsupplies.co.uk and
www.hookandloopfasteners.co.uk
for this example of Norman's custom work. - https://community.sellerdeck.com/forum/sellerdeck-ecommerce-software/sellerdeck-desktop-v18/557267-search-console-strange-results?p=557489#post557489
Sellerdeck will often use cgi link in favour of a direct link from marketing lists and elsewhere which can cause issues with Google crawling and ranking.
"I bypassed the cgi link in favour of a direct link some time ago, this does not affect logged in customers and allowed me to add a 'no-follow' to cgi bin links in my robots.txt file: "
User-agent: Googlebot User-agent: Googlebot-image User-agent: * Disallow: /cgi-bin/ Allow: / Sitemap: https://www.hookandloopfasteners.co.uk/sitemap.xml
"This was a file created by the late and great Norman, now given he did make all his work public I am sure he would be OK with this being available here (it was also initially started on the forum by another member years back so has always been on this forum in one form or another)."
First create a layout called DirectLink and populate the layout with the following code:
<actinic:variable name="CatalogURL" /><actinic:block php="true">
$dpecmajor = <actinic:variable name="ECMajorVersion" selectable="false" />;
$dpispreview = <actinic:variable name="IsPreviewMode" selectable="false" />;
include_once "getsectionfilename.php";
echo GetProdPageName("<actinic:variable name="ProductID" selectable="false" />");
</actinic:block>#<actinic:variable Name="EncodedProductAnchor" />
Now copy the code below and name it getsectionfilename with a .php file type (getsectionfilename.php) in your site folder, close and re-start SD.
<?php
/***************************************************************
* GetSectFileName - A support function for Ref2File
***************************************************************/
function GetSectFileName($sectref)
{
global $dpecmajor, $dpispreview;
$previewprefix = $dpispreview ? 'P_' : '';
$connect = odbc_connect("ActinicCatalog" . $dpecmajor,"","");
$query = "SELECT [sPageName] FROM [Catalog Section] WHERE [nSectionID]=".$sectref."";
$result = odbc_exec($connect, $query);
while(odbc_fetch_row($result)){
$url = odbc_result($result, 1);
}
odbc_close($connect);
return $previewprefix . $url;
}
/***************************************************************
* GetProdPageName - Return Product Page FIleName if it exists - else Section File Name
***************************************************************/
function GetProdPageName($prodrefs)
{
global $dpecmajor, $dpispreview;
$previewprefix = $dpispreview ? 'P_' : '';
$prodrefs = str_replace("{","",$prodrefs);
$prodrefs = str_replace("}","",$prodrefs);
$connect = odbc_connect("ActinicCatalog" . $dpecmajor, "", "");
$query = "SELECT nParentSectionID, bGenerateSingleProductPage, sSingleProductPageName FROM [product] WHERE [Product Reference]='".$prodrefs."'";
$result = odbc_exec($connect, $query);
while(odbc_fetch_row($result)){
$parentid = odbc_result($result, 1);
$hasproductpage = odbc_result($result, 2);
$productpagename = odbc_result($result, 3);
}
odbc_close($connect);
if ( $hasproductpage ) return $previewprefix . $productpagename;
return GetSectFileName($parentid);
}
/***************************************************************
* GetProdParent - A support function for Ref2File
***************************************************************/
function GetProdParent($prodrefs)
{
global $dpecmajor, $dpispreview;
$prodrefs = str_replace("{","",$prodrefs);
$prodrefs = str_replace("}","",$prodrefs);
$connect = odbc_connect("ActinicCatalog" . $dpecmajor,"","");
$query = "SELECT [nParentSectionID] FROM [product] WHERE [Product Reference]='".$prodrefs."'";
$result = odbc_exec($connect, $query);
while(odbc_fetch_row($result)){
$parentid = odbc_result($result, 1);
}
odbc_close($connect);
return $parentid;
}
/***************************************************************
* GetSectParent- A support function for Ref2File
***************************************************************/
function GetSectParent($sectrefs)
{
global $dpecmajor, $dpispreview;
$sectrefs = str_replace("{","",$sectrefs);
$sectrefs = str_replace("}","",$sectrefs);
$connect = odbc_connect("ActinicCatalog" . $dpecmajor,"","");
$query = "SELECT [nParentSectionID] FROM [Catalog section] WHERE [nSectionID]=".$sectrefs."";
$result = odbc_exec($connect, $query);
while(odbc_fetch_row($result)){
$parentid = odbc_result($result, 1);
}
odbc_close($connect);
return $parentid;
}
/***************************************************************
* Ref2file - Use Actinic's pwn database, to convert a prod ref, to a filename
* @param int $ref the product reference.
* @author Gabriel Crowe + NormanRouxel 08 September 2007
*
* usage example: <a href="<actinic:variable name="CatalogURL" /><actinic:block php="true">echo Ref2file("<actinic:variable Name="ProductReference" />");</actinic:block>">Link Text</a>
***************************************************************/
function Ref2File($ref) {
return GetSectFileName(GetProdParent($ref));
}
function Ref2ParentFile($ref) {
return GetSectFileName(GetSectParent(GetProdParent($ref)));
}
?>
In any layouts that use cgi links (Best sellers, marketing, also viewed etc) replace the contents of your <a ref=""> tags (normally a couple, one surrounds the image and the other for the product title, you may have a third if you have a button in the layout, all will need to be changed for the new DirectLink layout) in the layouts eg.:
<a href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable name="ProductID" />&NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e" >&SHOP=<actinic:variable name="ShopID" /></actinic:block>">
With the "DirectLink" layout so it look like this:
<a href="<actinic:variable name="DirectLink" />">
This creates a static link rather than one that goes through the cgi bin. (take a look at Lee's homepage, the best seller slider uses the cgi bypass and the links are static .html as are all Lee's also bought lists etc): https://www.hookandloopfasteners.co.uk
The above was built from forum posts years back, Norman kindly simplified it and made it a user friendly patch that is unaffected by upgrades and requires no script changes.
As always backup first!
Another Norman addition supplied again by Lee Phillips
This code uses an alteration of add to cart from anywhere, automates it so it can go in also bought lists etc. however if the product has options the code will just show a more info button.
You’d just need to tweak styles and use your own in stock out of stock variables for the last two blockifs
<actinic:block php="true" >
$connect = odbc_pconnect("ActinicCatalog<actinic:variable name="ECMajorVersion" selectable="false" />","","", SQL_CUR_USE_ODBC);
$querySID = "SELECT nSectionID from ML_ProductSections WHERE [Product reference]='<actinic:variable name="ProductReference" encoding="perl" selectable="false"/>'";
$resultSID = odbc_exec($connect, $querySID);
$ProdSID = odbc_result($resultSID, 1);
$count="SELECT COUNT(*) AS Rows from ProductProperties WHERE [sProductref]='<actinic:variable name="ProductReference" encoding="perl" selectable="false"/>'";
$rs = odbc_exec($connect, $count);
$arr = odbc_fetch_array($rs);
If ($arr['Rows']>0)
{
$query = "SELECT sString3,sString2 from ProductProperties WHERE [sProductref]='<actinic:variable name="ProductReference" encoding="perl" selectable="false"/>'";
$result = odbc_exec($connect, $query);
while(odbc_fetch_row($result)){
$cproduct = odbc_result($result, 1);
$cprodref = odbc_result($result, 2);
}
odbc_close_all();
$href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable encoding="url" Name="ProductID" />&NOLOGIN=1";
$sButtonText = "More Info";
}
else
{
$sShort = "";
$nCount = 0;
$sOriginal = '';
$sOriginal = preg_replace('/\{.*?\}/', ' ', $sOriginal); // remove tabber headings
$sOriginal = preg_replace('/\!\!<|>\!\!/', '', $sOriginal); // remove!!< and >!!
$sOriginal = preg_replace('/<.*?>/', '', $sOriginal); // remove any HTML tags
foreach(explode(" ", $sOriginal) as $sWord)
{
if ($nCount > 0)
{
$sShort .= "...";
break;
}
$sShort .= $sWord . " ";
$nCount++;
}
$href="<actinic:variable name="OnlineScriptURL" value="Shopping Cart Script URL" />?SID=$ProdSID&PAGE=PRODUCT&Q_<actinic:variable name="ProductReference" />=1&O_<actinic:variable name="ProductReference" />=None+Required";
$sButtonText = "Add to Cart";
}</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsInStock%22%20%2f%3e"><div class="small_button_add_to_cart_also"><actinic:block php="true" >
echo "<a href="."\""."$href"."\"".">".$sButtonText."</a>";</actinic:block>
</div></actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsInStock%22%20%2f%3e%20%3d%3d%20false" ><div class="outofstock-also">Out of Stock</div></actinic:block>;
Along with many of the other Sellerdeck Partners I shall be offering support and patching of scripts as I am able.
Please email to make an enquiry
Website by Graphicz
Keep in touch with Graphicz Ltd website design and share
07836 551000. 01323 872296.
Email: