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

Cart Page Fields & Modifications

Started by PRO, August 15, 2012, 15:10:06 PM

Previous topic - Next topic

Stonedfury

#60
My theme already has the ability to hide modules that was why I asked about the code. So I can have it check for cart & category for my left and right. There's a bug only on the checkout page when selecting the payment. The page refreshes and the side modules load. However! When I add the code to the other module positions they do not appear as it is in the template. I have metamod-pro already but this is just easier with it already built in. I have also tried to make a few other modifications to the cart but they are failing in one way or another.

I figured out a way to load the BT in the ST area and have them both display with different links and description. I just am not smart enough to figure out how to hide one if the other is present. Figured it out with your code to show the button for adding a ST if BT is present. Splendid.

Thank you though for replying again.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

Stonedfury

I said to have it check for category when I meant productdetails. This code is not working <?php if ($this->countModules('moduleposition') and JRequest::getCmd('view')!=='cart' or ('view')!=='productdetails'): ?>
When I only use the <?php if ($this->countModules('main-top') and JRequest::getCmd('view')!=='cart'): ?> it works perfect and removes modules from cart page based on a setting. However I need to have the or work so that it will also hide them on productdetails. I figure whatever I am missing is small as that code doesn't give any errors but doesn't do the or. I am so puzzled by this. The Virtueplanet team doesn't like how I am changing their template I guess as they argue instead of answer when I ask there.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

PRO

this works


                <?php if (($this->countModules('moduleposition')) && (JRequest::getVar('view')!='category') && (JRequest::getVar('view')!='cart') ){}
               
                ?>




Stonedfury

I did 5 searches and this one kept coming up and the others are just crap.

I have set a default country 223 so that users don't have to scroll through the massive list. However now the country is showing the bt address already as it is the default. Is there a way to now show that until all details are submitted. I modified my template to show the bt as the st unless a st has been provided code.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

AH

Do you have any idea how to add a validation on the ZIP code entry for BT and/or ST

Cannot fathom how to do this for VM2, have spent much time looking at in:-   administrator/components/com_virtueamart/models/userfields

I sorted all this out in VM 1.1   http://forum.virtuemart.net/index.php?topic=92466.msg361004#msg361004


Any help appreciated to set me in the right direction  :-[
Regards
A

Joomla 4.4.5
php 8.1

PRO

Quote from: Stonedfury on May 21, 2013, 23:11:21 PM
I did 5 searches and this one kept coming up and the others are just crap.

I have set a default country 223 so that users don't have to scroll through the massive list. However now the country is showing the bt address already as it is the default. Is there a way to now show that until all details are submitted. I modified my template to show the bt as the st unless a st has been provided code.

WHAT?

PRO

Quote from: Hutson on May 22, 2013, 00:16:17 AM
Do you have any idea how to add a validation on the ZIP code entry for BT and/or ST

Cannot fathom how to do this for VM2, have spent much time looking at in:-   administrator/components/com_virtueamart/models/userfields

I sorted all this out in VM 1.1   http://forum.virtuemart.net/index.php?topic=92466.msg361004#msg361004


Any help appreciated to set me in the right direction  :-[

I do not sorry

AH

Oh no! Back to hours of searching through code  :'(
Regards
A

Joomla 4.4.5
php 8.1

Stonedfury

Quote from: PRO on May 22, 2013, 15:18:17 PM
Quote from: Stonedfury on May 21, 2013, 23:11:21 PM
I did 5 searches and this one kept coming up and the others are just crap.

I have set a default country 223 so that users don't have to scroll through the massive list. However now the country is showing the bt address already as it is the default. Is there a way to now show that until all details are submitted. I modified my template to show the bt as the st unless a st has been provided code.

WHAT?
Sorry I read what I wrote and it is confusing.
I set default country in vm backend to 223 (USA) Now when someone goes to the cart there is, in the bt and st, the default country showing but the bt and st are not complete and I would like to not show the country until all the details have been submitted. I added text to make it more apparent. www.pollenranch.com/store/cart
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

PRO

Quote from: Stonedfury on May 22, 2013, 17:35:33 PM
Quote from: PRO on May 22, 2013, 15:18:17 PM
Quote from: Stonedfury on May 21, 2013, 23:11:21 PM
I did 5 searches and this one kept coming up and the others are just crap.

I have set a default country 223 so that users don't have to scroll through the massive list. However now the country is showing the bt address already as it is the default. Is there a way to now show that until all details are submitted. I modified my template to show the bt as the st unless a st has been provided code.

WHAT?
Sorry I read what I wrote and it is confusing.
I set default country in vm backend to 223 (USA) Now when someone goes to the cart there is, in the bt and st, the default country showing but the bt and st are not complete and I would like to not show the country until all the details have been submitted. I added text to make it more apparent. www.pollenranch.com/store/cart

you can just NOT show it at all.

IF you look at the code below

this line
   if (($item['name']==='application' ) OR ($item['name']==='agreed') OR ($item['name']==='CommercialAddress') OR ($item['name']==='virtuemart_country_id')){continue;}

I skip application,agreed,CommercialAddress, and virtuemart_country_id


      <?php

      foreach($this->cart->BTaddress['fields'] as $item){
         if(!empty($item['value'])){
            if($item['name']==='agreed'){
               $item['value'] =  ($item['value']===0) ? JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_NO'):JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_YES');
            }
            if (($item['name']==='application' ) OR ($item['name']==='agreed') OR ($item['name']==='CommercialAddress') OR ($item['name']==='virtuemart_country_id')){continue;}
            ?><?php //if (($item['name']==='phone_1' ) OR ($item['name']==='fax') OR ($item['name']==='virtuemart_country_id')) echo $item['title'] ?>
               <span class="values vm2<?php echo '-'.$item['name'] ?>" ><?php echo $this->escape($item['value']) ?></span>
               <?php //if ($item['name'] == 'address_1' and $item['name'] != 'middle_name' and $item['name'] != 'zip') { ?>
            <?php if ($item['name'] == 'address_1' OR $item['name'] == 'address_2' OR $item['name'] == 'phone_1' OR $item['name'] == 'last_name' OR $item['name'] == 'email' OR $item['name'] == 'company') { ?>
               <br class="clear" />
            <?php
            }
            if ($item['name'] == 'city') { ?>
               ,
            <?php
            }
         }
      } ?>

Stonedfury

That's the default_pricelist.php right? Those values are not in my template override file. foreach($this->cart->BTaddress['fields'] as $item){

if(!empty($item['value'])){

if($item['name']==='agreed'){

$item['value'] =  ($item['value']===0) ? JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_NO'):JText::_('COM_VIRTUEMART_USER_FORM_BILLTO_TOS_YES');

}

?><!-- span class="titles"><?php echo $item['title'?></span -->

<span class="values vm2<?php echo '-'.$item['name'?>" ><?php echo $this->escape($item['value']) ?></span>

<?php if ($item['name'] != 'title' and $item['name'] != 'first_name' and $item['name'] != 'middle_name' and $item['name'] != 'zip') { ?>

<br class="clear" />

<?php

}

}

No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

PRO

are you talking about the values that I added to my file?


thats my file

Jumbo!

Quote from: Stonedfury on May 22, 2013, 21:35:06 PM
That's the default_pricelist.php right? Those values are not in my template override file.

These codes are also not is standard VirtueMart layout file. Check it yourself in components\com_virtuemart\views\cart\tmpl\default_pricelist.php

I am not sure how to accomplish your goal. But please understand PRO has suggested the change in his modified file which obviously not standard VirtueMart layout file so not in our template layout file.

PHP codes in our Template layout (default_pricelist.php) is exactly same as standard VirtueMart file. We have only played with the design part but not with the functionality.

Stonedfury

Quote from: Jumbo! on May 23, 2013, 20:05:39 PM
These codes are also not is standard VirtueMart layout file. Check it yourself in components\com_virtuemart\views\cart\tmpl\default_pricelist.php
I see this now after looking
Quote from: Jumbo! on May 23, 2013, 20:05:39 PM
I am not sure how to accomplish your goal. But please understand PRO has suggested the change in his modified file which obviously not standard VirtueMart layout file so not in our template layout file.
I see that after his post. I had to check for myself.
Quote from: Jumbo! on May 23, 2013, 20:05:39 PM
PHP codes in our Template layout (default_pricelist.php) is exactly same as standard VirtueMart file. We have only played with the design part but not with the functionality.
Never said you did. I was seeking a solution for my particular desire and that's why I asked questions.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

PRO

in the unmodified file


right before this

<span class="values vm2<?php echo '-' . $item['name'] ?>"><?php echo $this->escape ($item['value']) ?></span>


add this
   <?php if ($item['name']==='WHAT-YOU-WANT-TO-NOT-SHOW' ) {continue;} ?>


You do it both with the billing & shipping.