Download URL fix with HTTPS
This commit is contained in:
parent
1cc32d1740
commit
7163d1dd38
|
@ -50,6 +50,7 @@ class woocommerce_localisation {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -46,7 +46,8 @@ class WooCommerce_Widget_Cart extends WP_Widget {
|
||||||
if ( $title ) echo $before_title . $title . $after_title;
|
if ( $title ) echo $before_title . $title . $after_title;
|
||||||
|
|
||||||
echo '<ul class="cart_list product_list_widget">';
|
echo '<ul class="cart_list product_list_widget">';
|
||||||
if (sizeof($woocommerce->cart->get_cart())>0) : foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) :
|
if (sizeof($woocommerce->cart->get_cart())>0) :
|
||||||
|
foreach ($woocommerce->cart->get_cart() as $cart_item_key => $cart_item) :
|
||||||
$_product = $cart_item['data'];
|
$_product = $cart_item['data'];
|
||||||
if ($_product->exists() && $cart_item['quantity']>0) :
|
if ($_product->exists() && $cart_item['quantity']>0) :
|
||||||
echo '<li><a href="'.get_permalink($cart_item['product_id']).'">';
|
echo '<li><a href="'.get_permalink($cart_item['product_id']).'">';
|
||||||
|
@ -60,7 +61,9 @@ class WooCommerce_Widget_Cart extends WP_Widget {
|
||||||
echo '<span class="quantity">' .$cart_item['quantity'].' × '.woocommerce_price($_product->get_price()).'</span></li>';
|
echo '<span class="quantity">' .$cart_item['quantity'].' × '.woocommerce_price($_product->get_price()).'</span></li>';
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
else: echo '<li class="empty">'.__('No products in the cart.', 'woothemes').'</li>'; endif;
|
else:
|
||||||
|
echo '<li class="empty">'.__('No products in the cart.', 'woothemes').'</li>';
|
||||||
|
endif;
|
||||||
echo '</ul>';
|
echo '</ul>';
|
||||||
|
|
||||||
if (sizeof($woocommerce->cart->get_cart())>0) :
|
if (sizeof($woocommerce->cart->get_cart())>0) :
|
||||||
|
|
|
@ -620,13 +620,21 @@ function woocommerce_download_product() {
|
||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
// Get URLS with https
|
||||||
|
$site_url = site_url();
|
||||||
|
$network_url = network_admin_url();
|
||||||
|
if (is_ssl()) :
|
||||||
|
$site_url = str_replace('https:', 'http:', $site_url);
|
||||||
|
$network_url = str_replace('https:', 'http:', $network_url);
|
||||||
|
endif;
|
||||||
|
|
||||||
if (!is_multisite()) :
|
if (!is_multisite()) :
|
||||||
$file_path = str_replace(trailingslashit(site_url()), ABSPATH, $file_path);
|
$file_path = str_replace(trailingslashit($site_url), ABSPATH, $file_path);
|
||||||
else :
|
else :
|
||||||
$upload_dir = wp_upload_dir();
|
$upload_dir = wp_upload_dir();
|
||||||
|
|
||||||
// Try to replace network url
|
// Try to replace network url
|
||||||
$file_path = str_replace(trailingslashit(network_admin_url()), ABSPATH, $file_path);
|
$file_path = str_replace(trailingslashit($network_url), ABSPATH, $file_path);
|
||||||
|
|
||||||
// Now try to replace upload URL
|
// Now try to replace upload URL
|
||||||
$file_path = str_replace($upload_dir['baseurl'], $upload_dir['basedir'], $file_path);
|
$file_path = str_replace($upload_dir['baseurl'], $upload_dir['basedir'], $file_path);
|
||||||
|
|
Loading…
Reference in New Issue