Basket

wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Tue, 2012-02-07 13:01

First of all I would like to say a big thank you for gallery3 I love it...I would like some help if any is available to edit the Basket module. I have tried posting on the relavent forum to no-avail. I need it editing ever so slighltly, and from what I have read so do several other's. I need to edit the checkout page ( to remove offline payment and cheque payment) I kknow a little bit about php editing but not enough to find where these are in the module.

hope someone can help.

Pete

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Tue, 2012-02-07 18:43

The file you need to edit is checkout.html.php. It's in the ../modules/basket/views folder.
Celia

 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Sat, 2012-02-11 01:38

Thanks for your help Celia. I also ended up in Dashboard advance to edit some of the basket features there.
I'm almost there was just wondering if it's possible to put a paypal button checkout.html.php.....What do you think ?

 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Sat, 2012-02-11 02:55

I'm also looking for a checkbox to put in on the checkout page to say they have read the T&C's and not allow the customer to continue
without ticking the box.

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Sat, 2012-02-11 20:34

Do you mean a different button than the "Pay with PayPal" blue button?

Sorry, I don't know how to add a checkbox. Maybe somebody else could help?

Celia

 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Sat, 2012-02-11 22:40

Yes I was thinking of adding one of paypal's button, personally I think it instills more confidence when a customer recognises
paypal instantly.

With regards to the checkbox I will have a hunt round the forum thanks again for your help Celia

Pete

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Sat, 2012-02-11 23:23

I think you may be right. I found a Paypal page with all its buttons:

https://www.paypal.com/newlogobuttons

and added to my test site. I attached a picture.

If you like the way this page looks I can send you the checkout file.

Celia

AttachmentSize
checkout.jpg69.12 KB
 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Sat, 2012-02-11 23:36

Love it, it looks just as I wanted it to look thank you so much Celia for all your help,

I very much would love you to send me the checkout file please :)

Cheers

Pete

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Sat, 2012-02-11 23:51

Here is the modified checkout file. Remember that if you ever upgrade the basket module, you'll need to save this file first and make sure it's compatible with the new version.
Celia

AttachmentSize
checkout.html_.php2.46 KB
 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Sun, 2012-02-12 00:12

What did I do wrong..... I just got a string of ????? all I did was save the file as checkout.html_.php uploaded it to the
/modules/basket/views folder I then renamed the old file by puting a hyphen in front of it and renamed the new file by removing
the underscore.

Did I do it right ?

Cheers

Pete

 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Sun, 2012-02-12 00:21

Doh!!!!! Used MS word to paste it onto and microsoft being microsoft added a load of garbage at the beginning of the code once I'd remove it,
it works great.

Thank you again for all your help Celia, very much appreciated :)

Pete

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Sun, 2012-02-12 02:09

You're welcome.
Celia

 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Sun, 2012-02-12 11:31

Could I impose on you again please Celia

I have figured the html code for a checkbox but I have no idea how to prevent the customer from
continuing without ticking the box. Was wondering if you know how its done I have included the code
hope you can help.

Pete

AttachmentSize
checkbox2.html197 bytes
 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Sun, 2012-02-12 20:52

Pete,

It took some doing and a little time but I think I got it.

Try this new Checkout file. I added some code in two parts, inside a comment that reads:
<!--Code for Terms checkbox -->

In the <div id="terms"> you can modify the style, like adding more space separation.

And you can also change the text (Please select...).

Remember to rename and use just a text editor. :)

Now, I have to find a way to add a comment box to the basket...

Celia

AttachmentSize
checkout.html_.php2.97 KB
 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Sun, 2012-02-12 22:49

Celia
YOUR WONDERFUL thanks so much for this. I don't know how to put new code in I can to some extent move parts around.
Please be aware for anybody else using this it has a link to Yorkshire Photos T&C's so you would need to edit your own details in.

I have had shuffle about with the code and managed to get the paypal under the checkbox :) I have just a few more details to sort and
I'm hoping you can help again Celia. I would like the checkbox to be highlighted if the customer forgets to tick the box. Do you know how to
do that? I hope you do :) Ive included the changed checkout file

What sort of comment box are you wanting ? I've also added a bit of html code for a comment box.

AttachmentSize
Box.html_.txt222 bytes
checkout4.html_.php_.txt2.98 KB
 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Mon, 2012-02-13 00:33

How about this instead?

Change this line:

Quote:
/* Code for Terms checkbox */
if (document.our_terms.agree.checked == false){p=false;}
/* -----------------------------*/

to:

Quote:
/* Code for Terms checkbox */
if (document.our_terms.agree.checked == false){p=false; alert ("You need to agree to our Terms & Conditions.");}
/* -----------------------------*/

It will open an Alert box. You can change the text shown (between the quotes).
----
Edit:

I would also add some space between the table and the "Back to Basket" button:

Quote:
<?= $form ?>

<br />

<div class="basketbuttons">

 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Mon, 2012-02-13 09:58

Your amazing Celia, thank you once again for all your help it is very much appreciated.
If your ever over here in Yorkshire UK let me know and I'll buy you a coffee.

Cheers
Pete

 
dgfphoto99

Joined: 2009-04-15
Posts: 118
Posted: Mon, 2012-02-13 18:44

I am interested in the modifications that have been made. I also require the check box,however I wish to keep the options for offline and cheque paying. How to do I go about editing the checkout file to include these.

Any help greatly appeciated.

DGF

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Mon, 2012-02-13 20:28

You're welcome. If I ever go your way, I'll take you up on your coffee offer.

Celia

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Tue, 2012-02-14 21:12

DGF,

The file you need to modify is checkout.html.php (../modules/basket/views/checkout.html.php). Before making any changes, make a copy of this file as a backup.

To add the checkbox, find the code below and add the code inside the second quote level:

Quote:
function so(g){
var p=true;
var d=document.checkout;
if(!ci(d.fullname)){p=false;}
if((!ci(d.email))||(!ive(d.email.value))){se(d.email);p=false;}
if(!ci(d.phone)){p=false;}

Quote:
/* Code for Terms checkbox */
if (document.our_terms.agree.checked == false){p=false; alert ("You need to agree to our Terms & Conditions.");}
/* -----------------------------*/

if (p)
{
d.paypal.value=g;
d.submit();
}
}

Quote:
<div class="basket-right" id="payment" style="padding-left:10px;">
<h2>Payment Details</h2>
<?= $payment_details; ?>

Quote:
<!--Code for Terms checkbox -->
<div id="terms" style="padding-top: 20px;">
Please select to say you agree to our <a href="http://yourwebsite.com/terms-and-conditions/" target="_blank" >Terms & Conditions</a>
<form action="" method="POST" name="our_terms">
<input name="agree" type="checkbox" value="" />
</form>
</div>
<!------------------------------------>

You can change the text in:

("You need to agree...."). Keep it inside the quotes.

and in:

Please select to say you agree to our <a href="http://yourwebsite.com/terms-and-conditions/" target="_blank" >Terms & Conditions</a>

You need also to change "yourwebsite.com" and put there your domain name and the path to your terms & conditions.

The last change was to add the official PayPal button.

Quote:
<? if (basket::isPaypal()): ?>

Quote:
<div style="float:right;">
<a href="javascript: so(true)">
<img src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" align="left" style="margin-right:7px;">
</a>
</div>

<? else: ?>

Hope this helps.
Celia

----
Edit: Fixed the 1st. code on 2/14/12.

 
dgfphoto99

Joined: 2009-04-15
Posts: 118
Posted: Tue, 2012-02-14 10:33

Thanks for your prompt reply.

I have tried the above and whilst the checkbox shows and the paypal button appears, when I click on the paypal button or the offline option nothing happens. I am sure that it is something I have done (or not done!!)

Any ideas what might cause this.

Regards

DGF

 
wrathchild60

Joined: 2010-02-22
Posts: 25
Posted: Tue, 2012-02-14 17:50

This might seem daft but have you set up your paypal + offline payment in admin/basket/configure ?

Regards

Pete

 
dgfphoto99

Joined: 2009-04-15
Posts: 118
Posted: Tue, 2012-02-14 18:39

Hi

Yes I have done this. The basket has been working OK up until I did the above modifications. When I remove them everythig is OK. I do like the checkbox idea and the paypal button.

Regards

DGF

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Tue, 2012-02-14 20:04

No idea right now. I'll look into this and let you know.
Celia

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Tue, 2012-02-14 23:52

I'm sorry. I missed a character when copying and pasting. That "f (document..." should be "if (document...".

The first quoted code should be:

Quote:
/* Code for Terms checkbox */
if (document.our_terms.agree.checked == false){p=false; alert ("You need to agree to our Terms & Conditions.");}
/* -----------------------------*/

I fixed also the original message.

Celia

 
dgfphoto99

Joined: 2009-04-15
Posts: 118
Posted: Wed, 2012-02-15 10:39

Hi Celia

Thanks for the quick reply.

What you suggested above works just as I wanted. The only slight problem is that everything has been moved over to the right including all the contact information which I wanted kept in it's original position. I suspect I have done something wrong again!!.

Any suggestions gratefulyy received.

Thanks again

DGF

 
dgfphoto99

Joined: 2009-04-15
Posts: 118
Posted: Wed, 2012-02-15 15:36

Hi Celia

Have now rectified the problem everything is just working fine.

The basket module is great, all I need now is the ability to have discount codes!!

Thanks again

DGF

 
CeliaD

Joined: 2009-01-03
Posts: 47
Posted: Thu, 2012-06-14 23:25

Me too. Any idea about how to use discount coupons?
Celia