Satchmo Shipping Module Order Information - django

In my shipping module I'm trying to check the payment type and only return true for valid() if the payment type is not COD. Basically, I only want to give shipping choices of Local Delivery or Local Pickup if paying by COD and not allow actual shipping methods.
My problem is that in the valid() method of the shipping modules I don't know how to access the current order information. Is there a way to have the order information passed in to the init call? Or some other way to look it up?

After some more research I found a signal
shipping.signals.shipping_choices_query
This allowed me to filter the shipping options that are displayed.

Related

Magento communicating with another system

I'm building a magento (1.9CE) store which needs to interface with another system and I could use some guidance.
Although not particularly relevant, I'm communicating with the 'other' system using web services (it's on another server) but what I need help with is finding the places where I need to put in code to do what I want.
There are three major functions that I need to implement:-
When a user clicks on the product detail page I need to make a call to check the stock levels on the other system, update the magento stock levels and THEN display the product detail page.
When a sale is completed, I need to send details of that sale to the other system.
When a new product is added I need to communicate with the other system. This may be a bit more complex because there are a few checks I need to do during the 'add product' process, for example, check the SKU is valid, that tghe product doesn't already exists, etc. I think until I start coding this I shan't realise the full extent of this functionality!
Any guidance gratefully received!
Even though this might (and probably will) dramatically slow down your store, if you want real-time information, I guess the easiest way would be with observers.
You can use catalog_controller_product_init_before: This will trigger when the product detail page is starting loading, so you should be able to upload the stock at this point, before the page has finished loading, so that if there is no stock it will not be buyable, which I guess that's what you want.
You can use sales_order_place_after: This will be triggered after a new order has been placed and saved in the database.
You can use catalog_product_new_action or catalog_product_save_after: Depending on how you create your products the first one might not be triggered. The second one will always be triggered once a product (new or existing) has been saved, so at this point you will need to check if the product is new or existing, and do your stuff depending on that.
For an example of how to create an extension and usage of observer events, check this out.
I hope it helps!

Free shipping by number of items, not monetary value, in Bigcommerce

I've been asked by a client to look into the possibility of allowing free shipping for orders of more than three items. Essentially this means allowing for a (shipping) pricing structure based on item count rather than total value.
(For a TL;DR, you could probably stop with that problem statement, but I'll provide some solution investigation context below. Maybe I've missed something.)
The admin UI only allows for setting free shipping based on monetary value. Similarly, the "Ship by" category of price options adds the ability to use weight in calculations, but alas not item count.
There seems to be no way to influence the shipping cost through the API. A %%GLOBAL_ShippingPrice%% variable is available to templates and, as I understand things, is calculated only using those admin-configured shipping configuration options described above. The Shipping API only seems to deal with shipping methods (physical not API methods!), and unfortunately the Orders API seems to offer nothing related to shipping costs either. Hmm.
I've looked into hacking the template files, but cannot find any support for custom expressions using the variables available.
We've asked Bigcommerce support, submitted an "idea", and obviously searched the interwebs and poked around the developer documentation. I'm so new, I only heard about Bigcommerce yesterday.
Any suggestions will be greatly appreciated.
Note: First draft of this question included an inline screenshot and lots of relevant hyperlinks. Seems important for a quality question. Apparently I need more karma to insert most of that. I'll edit this question later, if possible and I ever get there, to include those helpful features.
Since Bigcommerce is not an open source platform, you cannot adjust things like shipping services and their actual functionality.
The only workaround I can think of would be to set every product to the same weight(1lb, for example) then set up shipping by weight which says cart >= 3lbs ships free. This will present a problem if you are using real time quotes from providers such as FedEx, USPS, or UPS though.
In the future I would suggest looking at their community forum(forum.bigcommerce.com) for questions such as this, since it does not actually pertain do the development of their API or templating system.
Best of luck!
This is possible if you use ShipperHQ. Here are the steps to configure it:
In ShipperHQ, ensure you have your UPS Carrier set with UPS Ground as
an available shipping method.
Click on Filters on the navbar and add
a new filter.
On your new filter, select “Whole Cart” under Filter
Applies To in the Edit Filter panel and enter a Name you’ll recognize
(e.g. “Over 3 items”).
In the Standard Filters panel, select “Range”
for the Quantity filter, enter a Min value of 3 and check the No Max
checkbox and Save.
You now have a filter set up which will match
against an order total with more than 3 items.
Click on Carrier
Rules on the navbar and add a new Rule.
Enter a descriptive Name
(e.g. “Free UPS Ground over 3 items”) under the Overview panel and
select UPS Ground in the Live Shipping Methods Assigned field under
the Applicable Shipping Methods panel.
In the Conditions panel,
select the Filter you just set up under Weight/Price/Quantity Filters
In the Actions panel and the Rule Action section, choose
“Set/Surcharge Shipping Methods” from the Action to Perform
drop-down, “Set Rates” from the Adapt Shipping Rates drop-down, and
“Per Cart” in the Apply Shipping Rate/Percentage drop-down.
In the
Set/Modify Shipping Rate section of the Actions panel, enter 0 in the
Shipping Rate field.
Save your rule.
ShipperHQ will now set UPS Ground to Free if the order has over 3 items.
Source: http://docs.shipperhq.com/how-to-set-up-free-shipping-for-orders-with-more-than-x-amount-of-items/

How to disable Virtuemart2 default shipping

I have 2 shipping methods within Virtuemart & One Page Checkout (e-go & Fastways), and as a default on page load, "e-go" shipping is selected as a default!
I have tried everything to make "Fastways" the default shipping method; by modifying the list_order and id. But somehow "e-go" is always taking precedent?! Any clues as to how to prevent this?
ps: I've seen a post that makes a hack in virtuemart (but this isn't using One Page Checkout)...
Try changing the shipping method ordering. As Virtuemart shows the first one being selected. You will need to ordering of Shipping methods so that Fastways goes on top.

Nopcommerce change shipping rules code

I am using nopcommerce a open source shopping cart system. I want to change the shipping rules i.e. if any one buy a product of less than $1000 then he must pay a shipping charges of rupee $10 otherwise no shipping charges will apply. i want to do this through code. please help me.
You should create a new shipping rate computation method plugin. Please have a look at IShippingRateComputationMethod interface. Put all required logic into 'GetShippingOptions' method.
Nopcommerce has provide a new plugin for shipping rule "Shipping.Director" where you can write your own Expression for shipping you should try that one reference link
http://www.noptools.com/

Where I can find restaurant data for android application?

I would like to know if there is a free api that would allow me to get restaurant information for an android application. The Application is supposed to search for nearby restaurants and display to the user. The problem is that there are some criteria that the restaurants must satisfy. The specific information I need is: location, type of food (mexican, italian, burger, etc.), type of restaurant (sit-down, fast food, buffet, etc.). Would there be any api that would give me these information? I know that I can use apis like Google custom search but the problem is that the result may not include all the information I want to have on every query( type of food, type of restaurant...)
thanks
As mentioned, the Yelp! API allows you to filter based on a lot of categories. The other alternative would be the Google Places API, but that doesn't give you the sort of contextual information about the restaurant that you want.