Magento calculate shipping rates base on total weight, province and country
I am new to Magento and I need to calculate shipping rates base on total weight in cart, province and the country during checkout, I have created an api to output rates in json format, but I have no idea how to call to the api in Magento. Usually I used to request the api through http request, but in magento I don't know how to integrate my api in it.
is there any plugin so that I can simply use?
See also questions close to this topic

Magento After adding the double quote in attribute option swatch images not change in frontend
In Magento 1.9.1, I have added a size attribute and add a option to that size attribute as
Large 9.5" Tall x 7.5" Diameter & Small 2" Tall x 5.75" Diameter
. After adding this option with double quote (“) for inch the images not change after select the large or small option from dropdown. Please let me know how to fix this issue. Because we need double quote for display the inches.Error in console : Uncaught SyntaxError: Unexpected token t in JSON at position 28

How to add pagination for wishlist products in magento 1.9
I am trying to get products on the pagewise for wishlist collection. I was getting a count for product collections in the below code. I have set the page size to one but it's showing the product count two. Please help me to fix this. Thanks.
$wishlist1 = Mage::getModel('wishlist/wishlist')>loadByCustomer($customer, true) >setCurPage($page_num) >setPageSize(1) >load(); foreach($wishlist1>getItemCollection() as $product){ $_product = Mage::getModel('catalog/product')>load($product['product_id']);//product id here echo $product['product_id']; }

I was getting a cache validation error and i was gonna install a github extension for magento but got stuck here
I got stuck when I was trying to install the
github
extension formagento
on my site.The extension contains a
skin/
folder.Where am I supposed to upload it? What is the exact location in the directory?

How can I charge the highest shipping class in cart, and set discount for other classes in WooCommerce?
I have a WooCommerce shop with 20 shipping classes. When multiple products with different shipping classes are in the cart, I want to charge the most expensive shipping class in full and set 50% discount for other shipping classes in a cart.
Also, I have a couple of products with unique shipping classes that should never be discounted, even if the shipping class of that products is the lowest in a cart.
So far, I've tried utilizing almost all shipping plugins I could find for Woocommerce but none of them offers conditional logic that works in this case.
Any help is appreciated.

Woocommerce Shipping broken
Shipping isn't working for Woocommerce. I updated the Woocommerce version and took out other plugins and themes to test without possible conflicts and no joy.
When it goes to checkout page, if I put a different country in address, it isn't changing the shipping price accordingly.
Any ideas as to what this could be or where I can go from here.
Thanks in advance for any ideas
Vicky

how to add a section to the WooCommerce settings "Shipping" tab
The filter hook
woocommerce_sections_shipping
is not working to add a section tab to woocommerce shipping settings:if ( ! class_exists('WC_Shipping_Calculator')){ class WC_Shipping_Calculator{ public function __construct(){ add_filter('woocommerce_get_settings_shipping', array( $this, 'add_settings_tab'), 100); //add_filter('woocommerce_settings_tabs_array', array( $this, 'add_settings_tab'), 100); //add_filter('woocommerce_sections_shipping_array', array( $this, 'add_settings_tab'), 100); } public function add_settings_tab($settings_tabs){ $settings_tabs['shipping_calculator'] = __('Shipping Calculator', 'shippingcalculator'); return $settings_tabs; } } } $GLOBAL['wc_shipping_calculator'] = new WC_Shipping_Calculator();
What is the filter that I can use to add a section tab to woocommerce shipping settings?

How do i get freight shipping rates from diffrent carrier or shipping lines in laravel?
Does anyone here to know how to get freight rates of different shipping lines around the globe? I am using laravel. I have searched a lot of options but others were only limited to other countries and not accepting larger dimensions of cargo. Any help will be appreciated. Thank you.

Creating an A/B Test Sample Size Calculator from Evan Miller's Simple Sequential A/B Testing Blog
To learn more about A/B Testing sample sizes selection I am attempting to use Evan Miller's popular blogpost to recreate a sample size calculator (https://www.evanmiller.org/sequentialabtesting.html). However, there seems to be an error that prevents me from recreating the sample sizes given in article. What would you suggest I reexamine to find a solution to my problem?
This error must be in my calculation or my reading of the problem. Solving the constraint equations suggests a small sample size of ~6. The article suggests that the test statistic cutoff, which indicates if the treatment has a higher conversion rate than the control, is a function of the sample size. Then it list two inequalities to solve for one variable, N the sample size. How do I reproduce the sample size calculations?
Most of these problems would go away if the test statistic cutoff, d_star, wasn't a function of N.
d_star = z*Sqrt(N), N is the sample size and z is the normal zvalue
However, On the tables appearing the last half of the article d_star = z*Sqrt(N) relates N and d_star very precisely, which suggests d_star varies with N.
Constraints given alpha and beta: Sum R(p=1/(1+delta)) > 1  beta Sum R(p=1/2) < alpha
I'll append my Python 2.7 code and a plot for each constrain equation.
#### Begin Python Code to Calculate Sample Size #### import random import scipy.stats import math import sys print sys.version # Functions and helper functions to # calculate the sample size. def calcStatPowerSum(N, script_delta): z = scipy.stats.norm.isf(alpha/2.0) #1.96 for alpha = 0.05 d_star = z*(N**0.5) d_star = int(math.ceil(d_star)) statPowerSum = 0 for i in range(1, N+1): statPowerSum += (float(d_star)/i)*scipy.stats.binom.pmf((i+d_star)//2, i, 1.0float(1)/(2+script_delta)) # p and the (1p) terms are reversed relative to the binomial distribution return statPowerSum def calcCritValueSum(N, script_delta): z = scipy.stats.norm.isf(alpha/2.0) #1.96 for alpha = 0.05 d_star = z*(N**0.5) d_star = int(math.ceil(d_star)) critValueSum = 0 for i in range(d_star, N+1, 2): critValueSum += (float(d_star)/i)*scipy.stats.binom.pmf((i+d_star)//2, i, 0.5) return critValueSum def determineSampleSize(alpha, beta, script_delta): z = scipy.stats.norm.isf(alpha/2.0) #1.96 for alpha = 0.05 d=1 N=int(math.ceil(z*z))1 statPowerSum = 0 critValueSum = 1 while (statPowerSum <= 1  beta or critValueSum >= alpha) and N<3000: d+=1 N=int(math.floor(d*d/z/z)) statPowerSum = calcStatPowerSum(N, script_delta) critValueSum = calcCritValueSum(N, script_delta) return N alpha = 0.05 beta = 0.8 lift = script_delta = 0.10 sampleSize = determineSampleSize(alpha, beta, script_delta) print("beta: ", beta, ", alpha: ", alpha, ", sampleSize: ", sampleSize) ## The article suggests that N=2922 satisfies the constraint equations. ## But the calculation suggests otherwise. print("calcCritValueSum: ", calcCritValueSum(2922, script_delta)) print("statPowerSum: ", calcStatPowerSum(2922, script_delta)) #### End Python Code ####
The following mathematica code reproduces the constraint plots as a function of d_star. Copy and pasting the code into https://sandbox.open.wolframcloud.com/ will generate these plots. Generating more than one plot at a time will exceed the free usage limit.
(* alpha constraint Plot *) z=1.96 (*alpha=0.05*) Table[Sum[(d/n)*PDF[BinomialDistribution[Floor[d^2/z^2], 1/2], (d+n)/2], {n, d, Floor[d^2/z^2], 2}],{d,1,130}] ListLinePlot[%, PlotRange>All, AxesLabel>{d_star,prob},PlotLabel>alpha Constraint Plot] (* 1beta constraint Plot *) delta=0.10 z=1.96 (*alpha=0.05*) Table[Sum[(d/n)*PDF[BinomialDistribution[Floor[d^2/z^2], (1+delta)/(2+delta)], (d+n)/2], {n, d, Floor[d^2/z^2], 2}],{d,1,130}] ListLinePlot[%, PlotRange>All, AxesLabel>{d_star,prob},PlotLabel>1 beta Constraint Plot]