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

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;

Related

WooCommerce Redirect Link Adding Two Items To Cart At One Time Not One Item At One Time

I came from a post about the topic I am inquiring about.
Summary of problem:
The post states that in WooCommerce to add items to cart and then redirect your URL use this link and add in your own personal links.
http://yourdomain.com/your_custom_page/?add-to-cart=25
The link works on my site but it adds two items to the cart at once not one.
That is my problem any help would be much appreciated.
I am new to this community and want to respect it.
Thank you for taking the time to read this post.

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

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

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 update the responses of the google form to the form itself

I am creating a Google Form. I want to insert a count in the end(anywhere,not specific) of the form which will show the number of responses submit till date.This goes like updating the live count. I have tried using script editor for Google Form Add-ons option.But I am unable to view the results automatically or changes. It asks me to accept "Terms of Service" which I don't want to do right now because I am not sure about the way it may result.
There are various options available to view the form results/responses.But here I don't want to view the results later.They should get updated when we click the submit button on form.Please note..simultaneously many users may fill the form.
To implement this,I have thought of logic like whenever submit button gets clicked..the text in the form should get updated.
Please suggest how I can add the count or apply above logic of whenever submit operation is performed. Is it possible?? Any other suggestions are welcomed..Thanks in Advance!!!
I found another possible way of doing this..I received all the responses in Google Spreadsheet..which I later embedded in my site. Solves the purpose..And the embedded data gets updated automatically for the responses !! Cheers

ASP.NET MVC 2: Emulating eBay Postback

Below is an image of the sections I'm talking about:
What I'm doing is very similar to eBay:
1) a form at the top for "search terms" and then a category.
2) filters on the left that a user can click to refine the search even further.
3) sorting those results.
I played with eBay a bit and it looks to me like they are posting back every time a filter (box on the left) is clicked, or when they sort the results. Do they then store a copy of all the "settings" used to display the page in the form and use that to post back on a submit click?
How can I emulate this functionality? I don't like the idea of wrapping an entire page in a form element... it seems dirty. Should I use jQuery to collect all of the user input and then somehow pass it along?
I'm not sure how eBay does it, but if it were me, I'd have some javascript object that keeps track of all the search options on the page. Each of the elements you've highlighted would fire an event that would cause my javascript object to update this information, send it via AJAX to a controller action, and update the results area with the changes.
That's a somewhat simplified version of events, but hopefully it can put you on the right track.
I've decided that the best solution is to use jQuery Ajax. Otherwise, I'd have to make sure that every peice of user input is a form element and wrap the entire page in a form tag.