spree shipping cost don't change with multiple items - ruby-on-rails

I am using spree online demo ,having some issues related to shipping cost calculation.While
trying to add a single product to cart and checkout ,then all works
fine, the shipping charge added to the total amount correctly.But the
problem is that when am trying to checkout using multiple number of
same type product the shipping charge remains as the same for single
product,the shipping charge must change according to products count.
Thanks in advnc
Rajith

you need to use another shipping calculator for that, i don't know if spree includes one for your desired behavior, or if there is one available as an extension. nevertheless, writing calculators is extremely simple, the spree docs provide good information about this topic:
http://guides.spreecommerce.com/shipping.html

Related

Spree active shipping rails gem create_shipment method never called

I'm integrating spree with active shipping to use fedex in my e-commerce website, and it looks like active shipping is used only for retrieving rates and not for create labels or get tracking numbers, github docs are very poor on this matter too, someone can explain me if I'm missing something?
Yes, spree_active_shipping is used to calculate the amount for the shipping method during the checkout process. It's not used for fulfilling the purchase.

Ruby on rails. Pay to post articles

I am have been using rails for about a week now and have created a website/app which for simplicity's sake we can call a job board. Users can create listings which other users can then apply for. Everything is working as desired. The next thing that I want to set up is the ability to charge users to create the listings.
After extensive searching, I can't find any tutorials that explain this process, just the typical cart and checkout for selling physical products.
I have been pondering solutions but I wanted to consult here for pro advice.
For the payment process (at least for now) I will most likely use active merchant and Paypal as I am based in Europe.
My current doubts are with setting up the modeling.
Would it be better to create a new model eg. 'credits', have users purchase 'credits', then run a variable when trying to create a 'job', eg. if_user_has_credits post the job else link to buy_credits_path, or is there a more direct way of achieving this through the already functional user and jobs models?
Any advice on setting up this functionality would be greatly appreciated.
Thanks.
I would try to create a credit system, so users just have to purchase credits and you can just drive the user to purchase credits in case they do not have enough for create a listing:
Simple one: Store the user' credit as balance field in the database, and all actions ("add", "deduct") are logged but not used to compute the latest balance. The balance-based way gives you fast access to the current amount
History based: Don't store the balance in database. The balance is computed by looking at the history of transactions, e.g. ("add", "deduct"). The history-based way gives you auditing. The history table should store the transaction, a timestamp, the balance before the transaction happened, and ideally a way to track the funds' source/destination.
You can use both. See the Ruby toolbox for bookeeping and Plutus
I recommend also using logging, and ideally read about secure log verification and provable timestamp chaining.
For logging details see techniques for ensuring verifiability of event log files

rails ecommerce donation center

I am trying to create a donation centre of sorts in Rails for a non-profit, using PayPal, and am wondering if I should start from scratch or use an existing eCommerce gem/platform.
I want to:
- list various "products", or donation types that a user can select, customize and pay for
- be able to send/serve downloadable files to a donor, depending on their donation type
- keep track of donors, donations and various custom bits of data the user enters
- add hooks to add donors to mailing lists, push donation notifications to social media, etc.
Basically, I want something that looks like a store and supports digital products, but processes donations instead of sales through PayPal.
Does anyone have experience using Spree (or something similar) to accept donations? I can't seem to find evidence that this works without a lot of hacking.
Thanks!
There are several ways of doing this, but each will require you to roll up your sleeves and get into the code. I would recommend, especially if you are learning rails, using Daniel Kehoe's "railsapp - Ruby on Rails Membership Site"
http://railsapps.github.com/rails-stripe-membership-saas/
It is a great tutorial and building block for what you are wanting to accomplish. Don't just copy/clone it and use it out the box, I would run through the tutorial to get a better understanding of what is going on and how you can customize it to meet your needs. It uses Stripe, for payment processing.

Paypal: how to update shipping costs after the payment, as done by Etsy?

I am working on a marketplace application similar to Etsy. Specifically, I am currently implementing the checkout process and I am struggling with the paypal payment implementation.
I would like to have a workflow similar to etsy:
customer to login/register on my website
customer redirected to paypal, entering delivery address and authorize the payment
customer redirected back to my website, eventually change the shipping address and complete the checkout
I don't understand how to take into account on step 3) of any changes that changes the order total. For instance, the customer may choose a different shipping country and therefore a higher or lower shipping cost may be paid. I don't want to cancel the previous payment and send back the customers to paypal to re-validate the payment, as this would most likely cause the customers to drop the order.
How do Etsy take into account these variations?
What kind of paypal payment type (Standard, Adaptive, etc) do they use?
It would be really appreciated if you could point me to some real word examples (I use ruby on rails, but any framework is welcome).
Your problem is that your step 3 doesn't really make sense. Let me explain.
In your step 2, above, as you probably know, you can only really give the customer a good shipping estimate when a delivery address is given. Until then, your estimate won't be as tight.
In your step 3, a payment processor (such as Paypal or Google Checkout) will adjust the order total based on shipping costs. (The details vary, see below for a Google Checkout example.)
After your step 3 is completed, this will complete the order. The processor will report back to your website saying the order is complete with the details. Your site does any final processing. (Your question above says "the customer may choose a different shipping country and therefore a higher or lower shipping cost may be paid" but this does not make sense to me. At this point, the order is done -- your site should not allow the user to change the shipping address -- unless the user wants to cancel the order entirely.)
Google Checkout
As for details, the Google Checkout API documentation offers many options you will be interested in. Read the "Shipping and Digital Delivery" section of the Google Checkout XML API Developer's Guide. These are the two that I think are most relevant:
Merchant-calculated shipping - For merchant-calculated shipping, you must operate a web service that calculates and returns shipping costs. Google Checkout will send your service a request containing the buyer's shipping address, the items in the order and the shipping methods that you offer. (You would have previously sent the items and shipping methods to Google in a Checkout API request.) Your web service then calculates the shipping cost for each shipping method and returns that information to Google.
Carrier-calculated shipping - For carrier-calculated shipping methods, you identify one or more FedEx, UPS or USPS shipping methods that you offer. Google will then dynamically calculate the shipping cost for each option based on the total weight of the items in your shopping cart. The carrier-calculated shipping document defines the specific shipping methods that Google supports for each of these carriers. For carrier-calculated shipping options, the default shipping cost is only used if Google fails in its attempt to obtain the carrier's shipping rates.
Refer to the documentation for full details. I would hope that option 2 works -- it seems to involve considerably less custom development work.
Paypal
Going through Paypal's docs is rather obtuse in comparison with Google Checkout's. So I'm going to point you in the right direction, but I'm not going to dig through all of it in detail just for you. Check out: Calculate shipping and taxes
Don't Forget Taxes
Bonus Material! Taxes can also vary based on the shipping location. Payment services have documentation that shows you how to do this.

Amazon Product API - How to get items for sale by price?

I have a strage requirement from a client, he needs to display a ramdom selection (100 - 200 items from mixed categories) of products for sale on & shipped by Amazon but ordered by price. The idea is to allow people find gift ideas based a user input price point.
I have been looking through the API docs but cannot see an obvious way to find search by price, I am thinking of writing a script to "copy" large parts of the amazon product catalogue into a local database & have it update every few weeks, then use this for user searches, but this does not feel right / their must be a better way.
Has anyone any experience with this type of problem? Thanks!
You would want to use the Amazon Product Advertising API. Using this API you would want to perform a SearchIndex-ItemSearch query. Possible parameters to ItemSearch are available on the API Docs here
You can see in the docs that you cannot query by MinimumPrice and MaximumPrice on SearchIndex: All. However, if you search specific indexes, it allows you to do a price related search.
I would guess that you can agree with your client which categories should the items be from. Then you can just query them one by one.
Amazon's database changes very often. Hence, caching data for a week without updating may not be desirable.

Resources