allanext
Forum Replies Created
-
So, the issue is that the environment variables
HTTP_GEOIP_COUNTRY_CODE
HTTP_GEOIP_POSTAL_CODEare not set, not sure on which GEO module you rely on or if it’s supposed to be part of woocommerce, i’ve changed the following to use a function from geoip-detect module to make it work:
private static function auto_warehouse_switch() { global $SHIPPING_ZONES_ENABLED; $found_warehouse = false; $geo_country_code = trim(strtoupper(getenv( 'HTTP_GEOIP_COUNTRY_CODE' ))); $geo_postal_code = trim(strtoupper(getenv( 'HTTP_GEOIP_POSTAL_CODE' ))); //PC::debug("GEO COUNTRY: $geo_country_code", "WAREHOUSE GEO"); //PC::debug("POSTAL CODE: $geo_postal_code", "WAREHOUSE GEO"); $geoInfo = geoip_detect2_get_info_from_current_ip(); $geo_country_code=($geoInfo->country->isoCode); //PC::debug("GEO COUNTRY AFTER: $geo_country_code", "WAREHOUSE GEO"); $alt_warehouses_list = self::get_alt_warehouses_list();Hi @joeleem0n,
it looks like it’s working with the plugin “Price Based on Country for WooCommerce”.
Cheers
- This reply was modified 6 years, 9 months ago by allanext.
This seems to be resolved with 1.2.4, thanks @joeleem0n !
- This reply was modified 6 years, 9 months ago by allanext.
This seems to be resolved with 1.2.4, thanks @joeleem0n !
This should be marked as resolved.
- This reply was modified 6 years, 9 months ago by allanext.
Hi @oscargare,
Thanks for your quick reply. I thought that but never tried it 🙂
Now it works, just for other people having the same issue: when testing you need to open a different browser or open the incognito mode because if you are logged in, even if you are connecting from a different country, you’ll still see the default currency.
Cheers
- This reply was modified 6 years, 9 months ago by allanext.
@joeleem0n i think the syntax issue is still there, i’ve simply fix it by making a change in the code, see https://wordpress.org/support/topic/role-based-pricing-3/)
But there some thing related to php or some coding standard of these hooks; on the configuration of the warehouses by going to woocommerce -> settings -> warehouses there isn’t any configuration displayed, and page displays the straight php code from line 108 of the file /wp-content/plugins/warehouse-popups-woocommerce/admin/class-warehouse-popups-woocommerce-admin.php
by changing:
?> <a href="admin.php?page=wc-settings&tab=warehouses" class="nav-tab <?php echo $current_tab?>"><?php echo __( "Warehouses", "warehouse-popups-woocommerce" )?></a> <?to:
echo "<a href=\"admin.php?page=wc-settings&tab=warehouses\" class=\"nav-tab $current_tab\">Warehouses</a>";it works!
Hi @joeleem0n,
I think the error is still there:
Plugin could not be activated because it triggered a fatal error. Parse error: syntax error, unexpected 'else' (T_ELSE), expecting function (T_FUNCTION) or const (T_CONST) in /Sites/wp/wp-content/plugins/warehouse-popups-woocommerce/admin/class-warehouse-popups-woocommerce-admin.php on line 147I’m not sure what is happening in the _e function, but changing the line:
?><h2><?php _e( 'Edit Warehouse Details', 'warehouse-popups-woocommerce' );?></h2><?phpto:
_e( 'Edit Warehouse Details', 'warehouse-popups-woocommerce' );it works.
I think @norgo wants to have different product (variations?) pricing based on the user’s group, for example wholesales pricing or a special pricing for a certain group of people
Best!