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 ... 11 12 13 14 [15] 16 17 18 19 ... 30   Go Down

Author Topic: Shopping cart  (Read 493499 times)

0 Members and 1 Guest are viewing this topic.

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 247
Re: Shopping cart
« Reply #280 on: April 23, 2007, 01:59:58 am »

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 ?

Logged

Nibbler

  • Guest
Re: Shopping cart
« Reply #281 on: April 23, 2007, 01:11:26 pm »

Try

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

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 247
Re: Shopping cart
« Reply #282 on: April 24, 2007, 01:39:41 am »

Thanx Nibbler

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

arges

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
  • Learning with the bests!
Re: Shopping cart
« Reply #283 on: April 26, 2007, 11:36:32 pm »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping cart
« Reply #284 on: April 27, 2007, 10:19:25 am »

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

arges

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
  • Learning with the bests!
Re: Shopping cart
« Reply #285 on: April 27, 2007, 02:37:24 pm »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping cart
« Reply #286 on: May 02, 2007, 09:20:57 am »

you can edit that in codebase.php ... pretty easy. Right after
Code: [Select]
//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
Code: [Select]
$pic_data['html'] = $shop_data.$pic_data['html'];and change it to
   $pic_data['html'] .= $shop_data;

AlexL

  • Translator
  • Coppermine frequent poster
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 189
    • Velvet Photos
Re: Shopping cart
« Reply #287 on: May 02, 2007, 11:50:49 am »

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

arges

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
  • Learning with the bests!
Re: Shopping cart
« Reply #288 on: May 03, 2007, 11:26:12 am »

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
Logged

davebursey

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Shopping cart
« Reply #289 on: May 03, 2007, 03:39:34 pm »

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

Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping cart
« Reply #290 on: May 03, 2007, 03:59:33 pm »

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
Code: [Select]
$return[0] += $amount*$price;
Same for photoshop_cart.php
find and replace with your formula (2x)
Code: [Select]
$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

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Shopping cart
« Reply #291 on: May 03, 2007, 04:34:58 pm »

hahaha, many thanks stramm, spot on!!

Here is my code

in include/function.inc.php
find the code
Code: [Select]
$return[0] += $amount*$price;.
replace with
Code: [Select]
php$photo_price += $price+(($amount-1)*$price)/2;
Then in photo_shop_cart.php
find two occurances of
Code: [Select]
$photo_price += $amount*$price;
and replace with
Code: [Select]
$photo_price += $amount*$price;
Voila.
This will apply a half price discount to any quantity over 1, of the same image bought
Dave
Logged

JohannM

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 247
Re: Shopping cart
« Reply #292 on: May 03, 2007, 06:19:29 pm »

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/

Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping cart
« Reply #293 on: May 12, 2007, 07:50:23 am »

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 ...

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

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping cart
« Reply #294 on: May 12, 2007, 11:05:08 am »

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
Code: [Select]
//comment out if you don't want the orders to appeare on the order confirmed pageDownside 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
« Last Edit: May 12, 2007, 03:04:03 pm by Stramm »
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping cart
« Reply #295 on: May 12, 2007, 03:21:30 pm »

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)
« Last Edit: May 12, 2007, 05:21:54 pm by Stramm »
Logged

zac

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 153
Re: Shopping cart
« Reply #296 on: May 13, 2007, 10:55:54 am »

Great !! Thanks Stramm :D
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Shopping cart
« Reply #297 on: May 14, 2007, 08:20:59 am »

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

Code: [Select]
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Shopping cart
« Reply #298 on: May 15, 2007, 01:04:22 pm »

Hi Stramm  - good upgrade.

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

dave
Logged

davebursey

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: Shopping cart
« Reply #299 on: May 15, 2007, 01:13:07 pm »

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
Logged
Pages: 1 ... 11 12 13 14 [15] 16 17 18 19 ... 30   Go Up
 

Page created in 0.026 seconds with 21 queries.