How do I add a discount code to my cart and send it to paypal checkout? - paypal

I'm trying to add a discount code field to my website in big cartel. I've set the available discount codes in bigcartel, but no discount field is shown when checking out. This is because I send users to PayPal to checkout. Is there a way to add a field for the discount code in my cart, then send that discount to paypal on checkout?
What I really need is an example of how to make an <input/> for the discount code such that it gets processed on form submission. I'm new to big cartel, and as far as I can tell I don't have the ability to change the code for how the cart form is processed.
I've been digging through bigcartel and PayPal's docs for a while now with no luck, and am hoping someone on here knows the solution, but any help would be appreciated.

You can add a discount field to the Cart page by using discount_code_input:
Enter discount: {{ cart.discount | discount_code_input }}
This is also documented here: https://help.bigcartel.com/developers/themes/#discountcodeinputdiscount-id-classname
Additionally there's a number of different variables used to check whether discounts are enabled, the amount, the code that was entered, etc: https://help.bigcartel.com/developers/themes/#variables-1
And finally, every Big Cartel theme is on GitHub, so you can download the theme code, run it locally with Dugway, and get a better idea of how our themes work. Here's Lunch Break for example: https://github.com/bigcartel-themes/lunch-break/blob/master/source/cart.html

Related

Created a custom styled PayPal checkout button on Shopify, but I was previously told this wasn't possible

As the subject states, I created a PayPal Checkout button by simply adding the HTML code for the button and modified the text and remove the PayPal logo image.
Normally the code below would be used to generate the button, which of course is limiting:
{{ content_for_additional_checkout_buttons }}
However, I have instead added this HTML in its stead:
<div class="paypal-checkout-button">
<button name="goto_pp" type="submit" id="paypal-express-button" class="additional-checkout-button additional-checkout-button--paypal-express" value="paypal_express">
CHECKOUT WITH PAYPAL
</button>
</div>
The button's functionality is perfectly fine; I even processed a test payment through it. A developer friend of mine told me it wasn't possible without some hacky solution; however, the simple HTML snippet above seems to be a perfect solution to customizing the PayPal button on the cart / product page.
Am I missing anything? Or is this perfectly fine to do?
Appreciate any you can provide on the matter.
It's not the button on the cart that Shopify people have issues/problems with.
It's the button on the checkout and that can't be modified (without a lot of hassle) unless the store owner has a Plus account. That is almost certainly what your developer friend is talking about.
Not to mention, of course, that changing the appearance of the button or forcing it not to appear before the Shopify checkout process is a violation of the PayPal express user agreement.

Generating a dynamic Buy Now button

I am currently speccing out a custom auction plugin for WordPress. One thing I would like to do for each item is to generate a dynamic Buy Now link that will redirect to a PayPal screen with the item name and final price.
From what I can see, the only way to generate one of these buttons is to go to the form that generates the buttons for you. Is there a js file that I can use to generate these buttons from a Wordpress admin area? If so, can someone please provide a link so that I can begin reading up on the documentation?
Thank you
There are several examples of how to create a "pay now" button on stackoverflow (with simple HTML form). I would rather not use the "insecure" forms.
For including it in Wordpress you need to create a PHP Script (Plugin) that creates you the button, either with a library or "by hand".
The second thing I would recommend is to give PayPal an URL they should call after a payment status change (IPN). Some libraries (as the one above) can help you with that.

How to display total number of items new to view shopping cart?

So in a nut shell I have created a simple e commerce website using paypal add to cart buttons with no problems - Its only now I should of considered using an opencart source PHP/Mysql, but it's to late now as it's pretty much done. My question is, is how can I display the total number of items next to view cart? something like this (1) is there a simple way to do this? I'm really struggling to find an answer, is there a small piece of code I need to change in the view cart form? my website is here, there is no other problems. www.diva-wear.co.uk
Thanks.
There is not going to be anything you can do with the button code itself, but you can track what your buyer is adding to the cart. If you enable and use PHP sessions, this can be as easy as storing the count of items in a session variable that you display next to the cart button.
You can run something similar to this when someone adds an item to their cart.
<?php
session_start();
$_SESSION['items_count'] = $_SESSION['items_count'] + 1;

Woocommerce how to change the URL before proceeding to checkout

I need to capture some information for a particular product category.
I am thinking is there a way I can change the proceed to checkout link to go to a custom URL (which will be a booking form with an action of going to the checkout page on submit) if the product category is in the cart.
I am a developer but in Java so do not know the structure and hooks very well but am sure I can get it together if
a) it is possible.
B) someone can help me which files to modify.
Thanks guys
I have fixed this by adding a filter on checkout:
add_filter('woocommerce_get_checkout_url', 'booking_redirect_checkout');

Paypal php passing handling fee parameter

Now I'm addind parameter - handling, but in Paypal page gedding label Shipping and handling , this label is not correct form me bacause I sell inteligence items and there is no shipping.
What parameter is same as handling but have label Handling
I try all items from this official page, but no one is what I need.
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
As far as I know you can't change the name of the parameter corresponding on the checkout page . Instead you use the cart upload button and pass the "handling" as line item so that it will be shown as another item on the checkout page .
Kindly refer the below link :
https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/cart_upload/
You can click the below link to see how it will look like :
https://www.paypal.com/cgi-bin/webscr?cmd=_cart&upload=1&business=seller%40dezignerfotos.com&item_name_1=Item+Name+1&amount_1=1.00&item_name_2=Handling&amount_2=2.00&