News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

edit shipping fields

Started by leahshanz, September 30, 2016, 09:56:11 AM

Previous topic - Next topic

leahshanz

Hi All
I am upgrading a J2.5/VM2 site to J3/VM3

on checkout (using onpeage checkout), it calls the shiiping fields, so Ship to this address and displays the fields. On the J25 site the markup was

input[type=radio]
label

therfore the styles could be applied input[type=radio]:checked+label

now they are the other way around with label as the parent and input as the child. Therefore i cannot apply the original styles when the input radio is checked.

where can i find the VM markup so i can switch the tags around, otherwise i have no way of styling the label when the input is checked. It seems odd that the markup is done this way in VM3

thanks in advance for any help

GJC Web Design

versions???

on the latest the markup is

<div class="vm-shipment-plugin-single">
<input type="radio" data-dynamic-update="1" name="virtuemart_shipmentmethod_id" id="shipment_id_1" value="1">
<label for="shipment_id_1">
<span class="vmshipment">
<span class="vmshipment_name">Self pick-up</span>
</span>
</label>
</div>


so simple to style
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

leahshanz

VM 3.0.16
it is the shipping fields that our not marked up correctly. I am not sure which file i need to edit.
So when i have something in the cart and checkout i add a billing address. i have the option to select Ship to. I click ship to then all the shipping fields show. The shipping fields have a custom field call ship to residentail or commercial which is a radio input. This is the markup that needs to be changed. I cannot find it anywhere.

apologies but i am not a vm expert

GJC Web Design

Quotehave a custom field call ship to residentail or commercial which is a radio input.

this isn't VM standard so assume u configured a Shopper Field?

to target these I normally add the name as an id in the render  id="field_<?php echo $field['name'] ?>

\templates\xxxxxxx\html\com_virtuemart\user\edit_address_userfields.php

e.g.

// Output: Userfields
?>
<div class="form-group" id="field_<?php echo $field['name'?>">
<label class="<?php echo $field['name'?>" for="<?php echo $field['name'?>_field">
<?php echo $field['title'] . ($field['required'] ? ' *' ''?>
</label>
        <?php if (VmConfig::get ('jchosen')) { ?>
        <div>
<?php echo $field['formcode'?>
        </div>
        <?php } else {
        
echo $field['formcode'];
        } 
?>

      </div>
<?php


gives


<div class="form-group" id="field_first_name">
<label class="first_name invalid" for="first_name_field">
First Name * </label>
                <div>
<input id="first_name_field" name="first_name" size="30" value="" class="required invalid" maxlength="32" aria-required="true" required="required" aria-invalid="true" type="text">         </div>
              </div>

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

leahshanz

#4
thank you for your help. I cant solve it. I think it is an override issue.


i have a file list_user_fields_shipping.php which is a template for onecheckout.

http://trojan3.yourdotcom.com.au/index.php/fitness-equipment/cart

if you add something to the cart and checkout you just click add address under shipment addresses. it should behave like the Shipment information radio check boxes just above the address. The fields in question are

The delivery will be made to a
Home address
Commercial address

It seems i can edit this file but i cannot seem to swap the label and input boxes around for the actual radio button not the label of the field itself which is  "The delivery will be made to a"
   if (in_array($field['type'], $arr))
         {      
              echo '<label for="'.$field['name'].'_field">'.$field['title'].'</label>';

         }
            echo ' </div>';
      
         
        $field['formcode'] = str_replace('type="', ' title="'.$field['title'].'" alt="'.$field['title'].'" placeholder="'.$field['title'].'" type="', $field['formcode']);       
         echo '<div class="formField" id="'.$field['name'].'_input">'."\n";

Sidenote:
the onepage template has this line which i thought might be where i need to render the layout in this case but i cant find ps_userfield
<?php echo $op_shipto; // will list shipping user fields from ps_userfield::listUserFields with modification of ids and javascripts ?>



really sorry and grateful for any help. This override was from the VM2 and I am trying to get it to work as it was on the old site which is proving to be very difficult. Thanks again

GJC Web Design

No idea.. if your using some 3rd party cart then u ask the guy who built it....
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation