Author Topic: Cart Page Fields & Modifications  (Read 127387 times)

Stonedfury

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: Cart Page Fields & Modifications
« Reply #60 on: May 02, 2013, 23:03:54 pm »
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

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: Cart Page Fields & Modifications
« Reply #61 on: May 03, 2013, 17:53:15 pm »
I said to have it check for category when I meant productdetails. This code is not working
Code: [Select]
<?php if ($this->countModules('moduleposition') and JRequest::getCmd('view')!=='cart' or ('view')!=='productdetails'): ?>
When I only use the
Code: [Select]
<?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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Cart Page Fields & Modifications
« Reply #62 on: May 03, 2013, 20:28:08 pm »
this works


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



J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Stonedfury

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: Cart Page Fields & Modifications
« Reply #63 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.
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2897
  • VirtueMart Version: 3.4
Re: Cart Page Fields & Modifications
« Reply #64 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  :-[
regards
A

Joomla 3.9.1
php 7.1

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Cart Page Fields & Modifications
« Reply #65 on: May 22, 2013, 15:18:17 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?
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Cart Page Fields & Modifications
« Reply #66 on: May 22, 2013, 15:21:18 pm »
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
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 2897
  • VirtueMart Version: 3.4
Re: Cart Page Fields & Modifications
« Reply #67 on: May 22, 2013, 15:49:54 pm »
Oh no! Back to hours of searching through code  :'(
regards
A

Joomla 3.9.1
php 7.1

Stonedfury

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: Cart Page Fields & Modifications
« Reply #68 on: May 22, 2013, 17:35:33 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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Cart Page Fields & Modifications
« Reply #69 on: May 22, 2013, 21:21:51 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
            }
         }
      } ?>
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Stonedfury

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: Cart Page Fields & Modifications
« Reply #70 on: May 22, 2013, 21:35:06 pm »
That's the default_pricelist.php right? Those values are not in my template override file.
Code: [Select]
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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Cart Page Fields & Modifications
« Reply #71 on: May 23, 2013, 13:06:57 pm »
are you talking about the values that I added to my file?


thats my file
J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

Jumbo!

  • 3rd party VirtueMart Developer
  • Full Member
  • *
  • Posts: 668
  • Full-stack Web Developer
    • www.virtueplanet.com
  • VirtueMart Version: Always latest
Re: Cart Page Fields & Modifications
« Reply #72 on: May 23, 2013, 20:05:39 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

  • Jr. Member
  • **
  • Posts: 266
    • Stonedfury
  • Skype Name: Stonedfury
  • VirtueMart Version: 2.0.24
Re: Cart Page Fields & Modifications
« Reply #73 on: May 23, 2013, 20:23:03 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
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.
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

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10328
  • VirtueMart Version: 3+
Re: Cart Page Fields & Modifications
« Reply #74 on: May 23, 2013, 21:28:44 pm »
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.

J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)