Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $chosen_methods = WC()->session->get('chosen_shipping_methods');
- $chosen_shipping = $chosen_methods[0];
- global $woocommerce;
- if (($chosen_shipping == "flat_rate:10" && $method->id == "flat_rate:10" && is_checkout()) OR ($chosen_shipping == "flat_rate:11" && $method->id == "flat_rate:11" && is_checkout())) :
- $customer = new WC_Customer();
- $shipping_country = WC()->customer->get_shipping_country();
- //var_dump ($_GET['id']);
- if (isset($_GET['id'])) {
- $gls_id = htmlentities(rawurldecode($_GET['id']));
- $gls_name = htmlentities(rawurldecode($_GET['name_gls']), ENT_QUOTES );
- $gls_address = htmlentities(rawurldecode($_GET['address']));
- $gls_city = htmlentities(rawurldecode($_GET['city']));
- $gls_zipcode = htmlentities(rawurldecode($_GET['zipcode']));
- //rozlisuje ci je PSC CZ alebo SK
- $sk_psc = array(0, 8, 9);
- if (in_array(substr($gls_zipcode, 0, 1), $sk_psc)) {
- $gls_country = "SK";
- }
- else {
- $gls_country = "CZ";
- }
- if ($gls_country == $shipping_country) {
- ?>
- <p class="shippingDescription"><u><strong>Odběrné místo vybráno:<strong></u></p>
- <p class="shippingDescription"><?php echo $gls_id; ?></p>
- <p class="shippingDescription"><?php echo $gls_name; ?></p>
- <p class="shippingDescription"><?php echo $gls_address; ?></p>
- <p class="shippingDescription"><?php echo $gls_city; ?></p>
- <p class="shippingDescription"><?php echo $gls_zipcode; ?></p>
- <input type="hidden" name="gls_parcelshop_id" value="<?php echo htmlspecialchars($gls_id); ?>" required>
- <input type="hidden" name="gls_parcelshop_name" value="<?php echo htmlspecialchars($gls_name); ?>">
- <input type="hidden" name="gls_parcelshop_address" value="<?php echo htmlspecialchars($gls_address); ?>">
- <input type="hidden" name="gls_parcelshop_city" value="<?php echo htmlspecialchars($gls_city); ?>">
- <input type="hidden" name="gls_parcelshop_zipcode" value="<?php echo htmlspecialchars($gls_zipcode); ?>">
- <? }
- else {
- wc_clear_notices();
- wc_add_notice( 'Vyberte si GLS ParcelShop dostupný ve Vašem regionu.', $notice_type = 'error' ); ?>
- <p class="shippingDescription"><a href="https://help.gls-czech.cz/cs/maps">Vyberte odběrné místo</a></p>
- <?}
- } else { ?>
- <p class="shippingDescription"><a href="https://help.gls-czech.cz/cs/maps">Vyberte odběrné místo</a></p>
- <?}?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement