Shopping cart - Page 15 Shopping cart - Page 15
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Shopping cart

Started by Stramm, June 04, 2006, 09:02:32 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

JohannM

Sorry Nibbler ... I'm tired trying to figure this out.

What I have done is added the line:

<input type="submit" class="button" name="continue_shopping" value="{$lang_photoshop['continue_shopping']}" />

after

<input type="submit" class="button" name="empty_basket" value="{$lang_photoshop['empty_basket']}" />

(* Also fixed the lang file)

and

if (isset($_POST['continue_shopping'])) {
photoshop_refresh($_SERVER['PHP_SELF'].'?file=displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}$uid_link'); // TO FIX LINK
      exit;
   }

after

   } 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;
   }

Question:  I do get an error ... but is this possible to get the code to work ?


Nibbler

Try

photoshop_refresh("displayimage.php?album=$aid$cat_link&amp;pos={$thumb['pos']}$uid_link"); // TO FIX LINK

JohannM

Thanx Nibbler

I get this error: "The selected album/file does not exist !"

arges

Hello!!
I have a coppermine gallery with photo shop plugins configured correctly.
But i need to insert a button in the bottom of a image or in a thumbnail for my customers choose "add to cart" correctly with the right image.
How i put a radio button with the correct image,in the description under the image?

Have any solution for my problem?

my gallery is http://shishas.4sql.net/geral/
Thanks  :D

Stramm

if you mean in thumbnail view, then that functionality isn't coded into this plugin

arges

Hey
Can you help me ,to improve the plugin...
I want insert a button under the bottom of some images , for my customers buy the specific image that belongs to a produt.
I think with some aditional code we can do this,every image have a code id item that belongs to the right image.
I want eliminate the choose button that i have now there in the top of the images,and put only a button in the bottom that have "add" to basket .

The photo shop plugin works good,but for me this aditional code it will be perfect for my website!
Thanks, :D

Stramm

you can edit that in codebase.php ... pretty easy. Right after
//loop through the items and create forms

The shops form (dropdown) gets calculated and saved into a var ($shop_data)
Change that to your needs. Make it a button or whatever.

To make it appeare below the intermediate image and not above you have to scroll down a few lines, find
$pic_data['html'] = $shop_data.$pic_data['html'];
and change it to
   $pic_data['html'] .= $shop_data;

AlexL

[Off Topic]
Quotei need to insert a button in the bottom
A nice way to feel pain?  ;) ;D
[/Off Topic]

arges

Thank you Stramm for your help!
Your are the best here! ;)
And thanks for make this good plugin and give suport!
I not very good leading with code,but i like it,its something for me, new to start and discovery!
This is the code that i guess i need to change like you said to me in the last post:


         <form action="{$REFERER}" method="post">
              {$added}{$lang_photoshop['buy']} {$html}
            <input type="hidden" value="{$pic_data['pid']}" name="pid" />
            <input type="hidden" value="add_item" name="event" />
             <input type="submit" value="{$lang_photoshop['send']}" class="comment_button" />
                        <input type="submit" value="Add to cart">
                       
         </form>


I add "<input type="submit" value="Add to cart>" The submit button to make the purchase,but is not storing the results in the variable,i want to save the value into the var ($shop_data) correctly like you said,but i dont know how...


If i change "$pic_data['html'] = $shop_data.$pic_data['html'];" to "$pic_data['html'] .= $shop_data;" i can see the images,after the change,so i left the code in the same.

Thanks,
Sandra

davebursey

Hi Stramm,

Im trying to implement a cart-wide discount system for your Photo Shop. Its fairly simple. Any second, third fourth copies of any image ordered are recieved at half price.
So if at the moment we say that your cart calculates a sub total for an item by
quantity x price = subtotal

this discount could be applied by modifying this to

Price + ( {quantity-1} x price)/2 = subtotal

If we have one copy in the cart this will be charged at full price
If we have two copies in the cart, the second would only add half of the price on etc etc

Great.

Now if i were to try and implement this, could you point me in the right direction. My PHP is limited, but im playing catch up a little, to try and sort this!!

Many thanks
Dave


Stramm

If I remember right, then there are 2 places where you need to do some changes

1. functions.inc.php (the plugins one)
find and edit the formula as you need it
$return[0] += $amount*$price;

Same for photoshop_cart.php
find and replace with your formula (2x)
$photo_price += $amount*$price;

The code in photoshop_cart.php is kinda redundant. I've written the function and use it nearly everywhere but haven't optimized the code in photoshop_cart.php yet.


davebursey

hahaha, many thanks stramm, spot on!!

Here is my code

in include/function.inc.php
find the code
$return[0] += $amount*$price;.
replace with php$photo_price += $price+(($amount-1)*$price)/2;

Then in photo_shop_cart.php
find two occurances of
$photo_price += $amount*$price;

and replace with
$photo_price += $amount*$price;

Voila.
This will apply a half price discount to any quantity over 1, of the same image bought
Dave

JohannM

Hi Stramm

I'm busy creating and upgrading my website with coppermine 1.4.10.  I'm using your photo_shop plugin as my primary on-line sales tool.

By the way I think you did a freat job with it sofar !  I think (and know) that your ohoto shop will be used by many, it's a great add-on to coppermine.

However ...

Is it possible to edit the files so you can sent the txt email (and check_out page) to display the items baught ... nicely in a row ( ID, Type, Size, Amount, Total, etc) ?

Also, I have read here somewhere for the users to have a "My Orders" section. Will this materialize ?

It will be nice for them to get a history of their online orders, and a detailed ORDER or INVOICE as suggested above.

Anyway, hope to get a reply from you soon ...

Feel free to test my website at:  http://www.youth-sport-fotos.com/fotos/


Stramm

Quote from: JohannM on May 03, 2007, 06:19:29 PM
Is it possible to edit the files so you can sent the txt email (and check_out page) to display the items baught ... nicely in a row ( ID, Type, Size, Amount, Total, etc) ?

This of course is possible. Some code needs to be rewritten for that. Atm there's no function yet for creating the basket and the checkout list. So one either needs to code the exact same stuff a third (or fourth) time or you write a function and think about a template system for that. A lot of work ...

Quote from: JohannM on May 03, 2007, 06:19:29 PM
Also, I have read here somewhere for the users to have a "My Orders" section. Will this materialize ?

Such a 'My Orders' section isn't that hard to do if you integrate the link into the sub (or sys) menu. Basically a stripped down version of the admin system. If you however (my fav) don't want to clutter the menu even more, then the only option where you could place the link elsewhere is the users profile. Unfortunately there are no plugin hooks (and it's fairly complex to add some there) so you'd have to mod that file.

Stramm

#294
Quote from: JohannM on May 03, 2007, 06:19:29 PM
Is it possible to edit the files so you can sent the txt email (and check_out page) to display the items baught ... nicely in a row ( ID, Type, Size, Amount, Total, etc) ?

OK, I've added some basic invoice feature. It automatically gets sent with the order confirmation email to the user and the webmaster. There's a new entry in the lang file that defines the invoice header (your address).

The invoice is in plain text. I've put it in pre tags if your email client is set to display all emails as html. However it has additional line breaks in that 'mode'. Best is to view the email as plain text.

I've decided to clear the shop cookie (after the user confirmed his order) somewhen later. So it's possible to display all the orders on the confirmation page again. If you do not want that, you need to uncomment in photo_shop_checkout.php the three lines after
//comment out if you don't want the orders to appeare on the order confirmed page
Downside of the addition is, that the cookie an be cleard after the confirmation page has been created. Means it still shows items in the basket while it is empty. When clicking continue or after the first refresh the cleared cookie has its desired effect and the basket shows as empty.
If you do not like that, move the code that clears the cookie to the place it has in the orig code.

edit: removed the attachment and uploaded a new photo shop version 1.3.4
http://forum.coppermine-gallery.net/index.php?topic=32231.0

Stramm

#295
new version 1.3.4 is out

new:
- invoice in confirmation emails (see above)
- discounts

edit:
I've decided to add one more
- MyOrders page
- Minithums support (if you use the modpack)

zac

Great !! Thanks Stramm :D

Stramm

to only ahow the 'MyOrders' button to logged in users replace the entire function photoshop_user_menu with

function photoshop_user_menu(&$html){
    global $template_sys_menu_spacer, $lang_photoshop;
    if (!strpos($html,'{CART_MENU}')) {
$html = str_replace('{SUB_MENU}','{SUB_MENU} <br /> {CART_MENU}',$html);
}
//if you do not want the MyOrders page then uncomment the following line and comment out the one with the menu entry
    //$cart_menu = "<a style=\"padding:2px;\" class=\"admin_menu\" href=\"index.php?file=photo_shop/photo_shop_cart\">".photoshop_count()." {$lang_photoshop['in_cart']}</a> ".$template_sys_menu_spacer." <a href=\"index.php?file=photo_shop/photo_shop_checkout\" style=\"padding:2px;\" class=\"admin_menu\">{$lang_photoshop['checkout']}</a>";
    $cart_menu = "<a style=\"padding:2px;\" class=\"admin_menu\" href=\"index.php?file=photo_shop/photo_shop_cart\">".photoshop_count()." {$lang_photoshop['in_cart']}</a> ".$template_sys_menu_spacer;
if (USER_ID) $cart_menu .= " <a href=\"index.php?file=photo_shop/photo_shop_myorders\" style=\"padding:2px;\" class=\"admin_menu\">{$lang_photoshop['myorders']}</a> ".$template_sys_menu_spacer;
$cart_menu .= " <a href=\"index.php?file=photo_shop/photo_shop_checkout\" style=\"padding:2px;\" class=\"admin_menu\">{$lang_photoshop['checkout']}</a>";

    $html = str_replace('{CART_MENU}',$cart_menu,$html);

    return $html;
}


Recommended cause anon users can't use that functionality and just get a 'No orders' message.

davebursey

Hi Stramm  - good upgrade.

How can i turn off 'my orders' completely - i cant spot it!!!

dave

davebursey

Sorry!! read the manual!!

I ve got it!

But i do seem to have a lost the thumbnail on the checkout page? what havnt i read!!?

Dave