Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Shopping Cart: Layout questions  (Read 4948 times)

0 Members and 1 Guest are viewing this topic.

PerformanceImagery

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Shopping Cart: Layout questions
« on: December 31, 2007, 05:57:35 pm »

I have the Shopping Cart up and running just fine, but would like to make a few slight tweaks to the layout based on the feedback from a few testers for me.  Please reference the attached image to make things easier.

Coppermine v1.4.14
Photo Shop v1.3.5
Final Extract v2.2

1.  I would like to clean up the look of the area circled in orange.  I would like to remove one of the : in front of the prices and I would also like to move the $ to the front of the price amount so that it displays in the correct format for US shoppers. 

2.  I would like to add a Checkout button like the one at the top of the attached image (highlighted in red) in the location next to Empty Basket also highlighted in red.  I think the code for the top checkout button should/could just be entered into this code from the photo_shop_cart.php file...

Code: [Select]
//the main cart
photoshop_create_cart_form($box);


echo <<<EOT
                <tr>
                        <td align="left" class="tablef" colspan="7">
                            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                    <td width="100%" align="center">
                                        <input type="hidden" name="box" value="{$box}" />
EOT;
if ($box=="photo"){ // if we display photos, not cd, then display 'change amounts submit button'
echo <<<EOT
                                        <input type="submit" class="button" name="apply_modifs" value="{$lang_photoshop['save_amounts']}" />
EOT;
}
echo <<<EOT
<input type="submit" class="button" name="empty_basket" value="{$lang_photoshop['empty_basket']}" />
                                    </td>
                                </tr>
                            </table>
                        </td>
                </tr>
EOT;




endtable();
echo '</form>';

But where do I find the code for the button?  Keep in mind I do not want to remove the original button, just add another "copy" of it.

3.  I would also like to add a "Continue Shopping" button in the blue highlighted area of that same page.  I was able to find some code in this thread/post, but it was never mentioned if it actually worked.  I would be happy with this button sending the shopper back to either the page they were on before clicking on the "X images in cart" button or the main gallery page.

Thank you for any help and Happy Holidays!

Keith
« Last Edit: January 02, 2008, 06:44:13 pm by Stramm »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping Cart: Layout questions
« Reply #1 on: January 01, 2008, 11:58:32 am »

1. plugins/photo_shop/include/functions.inc.php
find and replace function photoshop_format_price with the one in this post

Code: [Select]
//calculate and format total, discount, shipping
function photoshop_format_price($temp_price, $cd_counter, $error='', $template){
global $lang_photoshop, $SHOP_CONFIG;

$out =array();
$discount_calc = calculate_discount($temp_price, $cd_counter);
$shipping_calc = calculate_shipping();
$discount = number_format(($discount_calc),2);
$shipping = number_format(($shipping_calc),2);
$tot_price = number_format(($temp_price[1]+$temp_price[0]+$shipping_calc-$discount_calc),2);
$cd_price = number_format($temp_price[1],2);
$photo_price = number_format($temp_price[0],2);

if ($cd_price > 0) {
$cd_price2 = "{$lang_photoshop['on_cd']}: {$cd_counter['cd']} {$lang_photoshop['pics']} : {$lang_photoshop['USD']} $cd_price&nbsp;<br />";
} else $cd_price2 = '';
if ($photo_price > 0) {
$photo_price2 = "{$lang_photoshop['for_print']}: {$cd_counter['photo']} {$lang_photoshop['pics']} : {$lang_photoshop['USD']} $photo_price&nbsp;<br />";
} else $photo_price2 = '';

if ($tot_price > 0) {
if ($shipping > 0) {
$total_price = "{$lang_photoshop['shipping']} : {$lang_photoshop['USD']} {$shipping}&nbsp;<br>";
} else $total_price = "";
if ($discount > 0) {
$total_price .= "{$lang_photoshop['discount']} : % {$lang_photoshop['USD']} {$discount}&nbsp;";
}
$total_price .= "<hr size=\"1\" width=\"200\" align=\"right\" />&nbsp;";
$total_price .= "{$lang_photoshop['total']}: {$lang_photoshop['USD']} {$tot_price}&nbsp;";
} else $tot_price = '';

$out['html'] = <<<EOT
<tr>
<td colspan="6" align="center">
<hr size="1" />
</td>
</tr>
<tr>
<td colspan="6" align="right">
{$photo_price2}
{$cd_price2}{$error}
{$total_price}

</td>
</tr>
EOT;
$out['text'] = sprintf("%+63s\n\n", '');
if ($photo_price > 0) { $out['text'] .= sprintf("%+63s\n", $lang_photoshop['for_print'].': '. $cd_counter['photo'].' '.$lang_photoshop['pics'].' :: '.$lang_photoshop['USD'].' '.$photo_price); }
if ($cd_price > 0) { $out['text'] .= sprintf("%+63s\n", $lang_photoshop['on_cd'].': '. $cd_counter['cd'].' '.$lang_photoshop['pics'].' :: '.$lang_photoshop['USD'].' '.$cd_price); }
if ($shipping > 0) { $out['text'] .= sprintf("%+63s\n", $lang_photoshop['shipping'].' :: '.$lang_photoshop['USD'].' '.$shipping); }
if ($discount > 0) { $out['text'] .= sprintf("%+63s\n", $lang_photoshop['discount'].' :: %'.$lang_photoshop['USD'].' '.$discount); }
$out['text'] .= sprintf("%+63s\n", '--------------------------');
$out['text'] .= sprintf("%+63s\n", $lang_photoshop['total'].': '.$lang_photoshop['USD'].' '.$tot_price);

return $out[$template];
}

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping Cart: Layout questions
« Reply #2 on: January 01, 2008, 12:39:13 pm »

2+3. photo_shop_cart.php
find
Code: [Select]
} elseif(isset($_POST['empty_basket'])) {
setcookie($CONFIG['cookie_name'] . '_cart', '', time() + 86400 * 30, $CONFIG['cookie_path']);
unset ($_SESSION['photoshop']['cart']);
  photoshop_refresh($_SERVER['PHP_SELF'].'?file=photo_shop/photo_shop_cart&box='.$box);
exit;
}
replace with
Code: [Select]
} elseif(isset($_POST['empty_basket'])) {
setcookie($CONFIG['cookie_name'] . '_cart', '', time() + 86400 * 30, $CONFIG['cookie_path']);
unset ($_SESSION['photoshop']['cart']);
  photoshop_refresh($_SERVER['PHP_SELF'].'?file=photo_shop/photo_shop_cart&box='.$box);
exit;
} elseif(isset($_POST['checkout'])) {
  photoshop_refresh($_SERVER['PHP_SELF'].'?file=photo_shop/photo_shop_checkout');
exit;
} elseif(isset($_POST['continue']) && isset($_POST['referer'])) {
photoshop_refresh($_POST['referer']);
exit;
}

find
Code: [Select]
<input type="submit" class="button" name="empty_basket" value="{$lang_photoshop['empty_basket']}" />
below add
Code: [Select]
<input type="submit" class="button" name="checkout" value="{$lang_photoshop['checkout']}" />

find
Code: [Select]
photoshop_create_cart_form($box);


echo <<<EOT
                <tr>
                        <td align="left" class="tablef" colspan="7">
                            <table border="0" cellspacing="0" cellpadding="0" width="100%">
                                <tr>
                                    <td width="100%" align="center">
                                        <input type="hidden" name="box" value="{$box}" />
after add
Code: [Select]
                                        <input type="hidden" name="referer" value="{$_SERVER['HTTP_REFERER']}" />
<input type="submit" class="button" name="continue" value="{$lang_photoshop['continue']}" />

in the lang file english.php after
Code: [Select]
  'myorders' => 'My Orders',

add
Code: [Select]
  //continue button
  'continue' => 'Continue shopping',


The header is sent by the browser, some browsers allow to modify the header (and so the referer). Some software firewalls block the referer (ie Norton). So the continue button might not work as expected for some people.
« Last Edit: January 02, 2008, 06:43:31 pm by Stramm »
Logged

PerformanceImagery

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Re: Shopping Cart: Layout questions
« Reply #3 on: January 01, 2008, 07:26:53 pm »

Thanks Stramm.

1. Working perfectly.

2. Has an issue.  In the fourth bit of code you posted, I think there is a cut and paste typo.  You have the value set to value="{$lang_photoshop['empty_basket']}".  I think that needs to be some thing like, value="{$lang_photoshop['checkout']}".  Im not sure if that is the correct thing to put in there though.  When I do this, the orginal top checkout button works correctly, but the new one does not.

3. Not working, see this new thread as I think it is a seperate/new issue.

Thank you for all your help.  If you have a way for me to send you funds, I'd gladly buy you a beer for all the hard work you do for everyone.

Logged

PerformanceImagery

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 31
Re: Shopping Cart: Layout questions
« Reply #4 on: January 02, 2008, 05:36:39 pm »

Issues 2&3 solved on the other thread (link posted in my last post).
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping Cart: Layout questions
« Reply #5 on: January 02, 2008, 06:44:02 pm »

perfect
I've edited the above instructions and fixed the wrong placeholder
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.