Different registration pages

  • Posts: 156
  • Thank you received: 0
13 years 5 months ago #18121

i need to create different registration pages based on the things in the cart.. how can i control what page they go to? what i am trying to do is show some fields and not others, how do i control the field that show based on what is the cart? i was thinking i can add the custom fields in the back end make them not visible, but in the registration view add some code that will control what gets view or not based in whats in the cart.

if this is a correct approach can i some sample code thanks

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
13 years 5 months ago #18147

That's indeed the correct approach.
The fields are displayed in the file custom_fields of the view user that you can edit via the menu Display->Views.
There, you need first to parse the products in the cart.
$product_there = false;
foreach($this->rows as $i => $row){
if($row->product_code=="my_product") $product_there = true;
}

then, in the foreach of the fields, if you don't want to display the field "my_field" when the product "my_product" is in the cart, you need to add at the beginning something like that:
if($product_there && $fieldName=="my_field") continue;

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds
Powered by Kunena Forum