Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 08-05-2010 15:35:59

Design_Wholesale
Member
From: England!
Registered: 11-21-2008
Posts: 1104
Website

How to Move Add to Cart and Wishlist buttons to Quantity Box Area

A quick guide to moving the  and  buttons to tidy up listings in your store and avoid the daft floating quantity box right at the bottom of the page. - This can be seen with the product listings on our site and is probably not recommended, but it works, - so make backups of your files before unleashing it on your webstore!

This guide is based on the UK version of the CCP software, so amend details accordingly if necessary.




remove the following code block (the printed display text will probably be different for your site, but the code section should still match):

Code:

if (($required) && ($show_wl)) {

     print '<p style="text-align: justify;">In order to proceed with your order please ensure that all fields marked with an asterisk 
     - <span style="color: black; font-weight: bold;">*</span> - have been completed, then click the <strong>' . $buttname . '</strong> or <strong>Would 
     Like To Purchase</strong> button if you have, or are planning on creating, an account and wish to add this item to a list for buying at a later 
     date.</p><br />' . $eol . $eol;

} elseif ($required) {

     print '<p style="text-align: justify;">All required fields are marked with an asterisk - <span style="color: black; font-weight: bold;">*</span>.  
     Click the <strong>' . $buttname . '</strong> button at the bottom of this form to proceed.</p><br />' . $eol . $eol;

} else {

     print '<p>Click the <strong>' . $buttname . '</strong> button at the bottom of this form to proceed.</p><br />' . $eol . $eol;

} // End of if statement.

then modify  so the entire file reads as shown below (again, the printed text will be different, but the code section should still match):

Code:

<?php

$app           = $this->globals('khxc_display.app');
$eol           = $this->globals('khxc.eol');
$formid        = $this->xhtml_encode($this->globals('khxc_form.formid'));
$buttname      = $this->globals('khxc_form.submit_modify');
$disablewl     = $this->globals('khxc_settings.' . $app . '.disablewishlist');
$form          = $this->xhtml_encode($this->globals('khxc_form.form'));
$url           = $this->xhtml_encode($this->globals('khxc_form.url'));
$upload        = $this->globals('khxc_form.upload');
$required      = $this->globals('khxc_form.required');
$desc_has_tags = $this->has_tags($this->globals('khxc_form.description'));


if (empty($buttname)) {$buttname = 'Submit';}
else {$buttname = $this->xhtml_encode($buttname);}

$isaddtocart = 0;

if (preg_match('/\-\-prodaddtocart/',$formid)) {$isaddtocart = 1;}

print '<p>';




if (empty($buttname)) {$buttname = 'Submit';}
else {$buttname = $this->xhtml_encode($buttname);}

$show_wl = 0;

if (preg_match('/\-\-prodaddtocart/',$formid)) {$show_wl = 1;}
if (!(empty($disablewl)))                       {$show_wl = 0;}

$method = 'post';

if (preg_match('/\-\-prodsearch/',$formid)) {$method = 'get';}
if (preg_match('/\-\-minisearch/',$formid)) {$method = 'get';}

if ($desc_has_tags) {

     $description  = $this->globals('khxc_form.description');

} else {

     $description  = $this->xhtml_encode($this->globals('khxc_form.description'));

} // End of if statement.

if (($required) && ($show_wl)) {

     print '<p style="text-align: justify;">In order to proceed with your order please ensure that all fields marked with an asterisk 
     - <span style="color: black; font-weight: bold;">*</span> - have been completed, then click the <strong>' . $buttname . '</strong> or <strong>Would 
     Like To Purchase</strong> button if you have, or are planning on creating, an account and wish to add this item to a list for buying at a later 
     date.</p><br />' . $eol . $eol;

} elseif ($required) {

     print '<p style="text-align: justify;">All required fields are marked with an asterisk - <span style="color: black; font-weight: bold;">*</span>.  
     Click the <strong>' . $buttname . '</strong> button at the bottom of this form to proceed.</p><br />' . $eol . $eol;

} else {

     print '<p>Click the <strong>' . $buttname . '</strong> button at the bottom of this form to proceed.</p><br />' . $eol . $eol;

} // End of if statement.




if (empty($isaddtocart)) {

     print '<br /><p style="padding: 0 0 0 10px;" /><input class="khxc_formbutton" type="submit" name="SUBMIT" id="';
     print $formid . '--SUBMIT" value="' . $buttname;
     print '" onclick="return DisableSubmit(\'' . $formid . '\');" ';
     print 'onkeypress="return DisableSubmit(\'' . $formid . '\');" />';

     print ' <input class="khxc_formbutton" type="submit" name="ns" id="';
     print $formid . '--CANCEL" value="Cancel" /></p><br />';

} else {

     print '<input class="khxc_formbutton" type="submit" name="SUBMIT" id="';
     print $formid . '--SUBMIT" value="' . $buttname;
     print '" onclick="return DisableSubmit(\'' . $formid . '\');" ';
     print 'onkeypress="return DisableSubmit(\'' . $formid . '\');" />';

     if (empty($disablewl)) {

          print ' <input class="khxc_formbutton" type="submit" name="WISHLIST" id="';
          print $formid . '--WISHLIST" value="Would Like To Purchase" />';

     } // End of if statement.

} // End of if statement.

print '</p>' . $eol . $eol;

print '</form>' . $eol . $eol;

?>

The important part when modifying  is that the following variables are declared:

Code:

$app           = $this->globals('khxc_display.app');
$eol           = $this->globals('khxc.eol');
$formid        = $this->xhtml_encode($this->globals('khxc_form.formid'));
$buttname      = $this->globals('khxc_form.submit_modify');
$disablewl     = $this->globals('khxc_settings.' . $app . '.disablewishlist');
$form          = $this->xhtml_encode($this->globals('khxc_form.form'));
$url           = $this->xhtml_encode($this->globals('khxc_form.url'));
$upload        = $this->globals('khxc_form.upload');
$required      = $this->globals('khxc_form.required');
$desc_has_tags = $this->has_tags($this->globals('khxc_form.description'));

...and that the following section is copied over from  (once again making allowances for printed text variances):

Code:

if (empty($buttname)) {$buttname = 'Submit';}
else {$buttname = $this->xhtml_encode($buttname);}

$show_wl = 0;

if (preg_match('/\-\-prodaddtocart/',$formid)) {$show_wl = 1;}
if (!(empty($disablewl)))                       {$show_wl = 0;}

$method = 'post';

if (preg_match('/\-\-prodsearch/',$formid)) {$method = 'get';}
if (preg_match('/\-\-minisearch/',$formid)) {$method = 'get';}

if ($desc_has_tags) {

     $description  = $this->globals('khxc_form.description');

} else {

     $description  = $this->xhtml_encode($this->globals('khxc_form.description'));

} // End of if statement.

if (($required) && ($show_wl)) {

     print '<p style="text-align: justify;">In order to proceed with your order please ensure that all fields marked with an asterisk 
     - <span style="color: black; font-weight: bold;">*</span> - have been completed, then click the <strong>' . $buttname . '</strong> or <strong>Would 
     Like To Purchase</strong> button if you have, or are planning on creating, an account and wish to add this item to a list for buying at a later 
     date.</p><br />' . $eol . $eol;

} elseif ($required) {

     print '<p style="text-align: justify;">All required fields are marked with an asterisk - <span style="color: black; font-weight: bold;">*</span>.  
     Click the <strong>' . $buttname . '</strong> button at the bottom of this form to proceed.</p><br />' . $eol . $eol;

} else {

     print '<p>Click the <strong>' . $buttname . '</strong> button at the bottom of this form to proceed.</p><br />' . $eol . $eol;

} // End of if statement.

...and that's it. - Done correctly you will now have a much tidier product listing display.


If you want to take this a step further and prevent duplicate messages with related products that use the product multi-add system, the following code modification to  can be used to restrict the message display on product listing pages by replacing the  statement in the  section:

Code:

// +--
// | Print multi-add table header.
// +--

if ($ns == 'prodshow') {

     print '';

} elseif (empty($disablewl)) {

     print '<p style="text-align: justify;">Enter a quantity for each item you would like to add to your <strong>Purchase List</strong> or <strong>Would 
     Like to Purchase</strong> list, then click the <strong>Add to Purchase List</strong> or <strong>Would Like To Purchase</strong> button below the 
     item details to proceed. All required fields are marked with an asterisk - <span style="color: black; font-weight: bold;">*</span>.</p>';

} else {

     print '<p style="text-align: justify;">Enter a quantity for each item you would like to add to your <strong>Purchase List</strong> and then click 
     the <strong>Add To Purchase List</strong> button below the item details to proceed. All required fields are marked with an asterisk 
     <span style="color: black; font-weight: bold;">*</span>.</p>';

} // End of if statement.

Last edited by Design_Wholesale (08-05-2010 16:07:57)

Offline

 

#2 04-22-2011 23:05:57

meshugy
Member
Registered: 12-18-2004
Posts: 348

Re: How to Move Add to Cart and Wishlist buttons to Quantity Box Area

Can you explain how this would be done in CCP7? I would really like to make this modification.

Thanks!

Michael

Offline

 

Board footer