snqke Posted February 15 Share Posted February 15 Hello, I'd like to customize the box for packages that i sell for example {{if $smarty.session.status_id!=3}} {{* do not show this link for premium users *}} <a data-href="{{if $smarty.session.user_id>0}}{{$lang.urls.upgrade}}/?service_id=13{{else}}{{$lang.urls.login_required}}{{/if}}" data-fancybox="ajax">Remove Ads/Get Premium</a> {{/if}} instead of showing the standard box view (in the screenshot), i'd like to create a new custom one and display it Quote Link to comment Share on other sites More sharing options...
Tech Support Posted February 15 Share Posted February 15 Please tell me why you want to have a new popup, instead of customizing the existing one? Quote Link to comment Share on other sites More sharing options...
snqke Posted February 15 Author Share Posted February 15 We have standard user that clicked on remove/ads button and i redirect to this package " {{$lang.urls.upgrade}}/?service_id=13 and when he choose one of these packages (check screenshot 1) he got error message because he don't have enough token , so i want to custom that popup and add a text "PURCHASE TOKENS" near the button "purshase" and when he click on it it will open the second popup like the screenshot 2 Thats why :) Quote Link to comment Share on other sites More sharing options...
Tech Support Posted February 16 Share Posted February 16 First of all you can add an error message into Website UI -> Texts having the following external ID: validation.upgrade.not_enough_tokens To show a better error message on this. To put a link to purchase tokens, you can update Upgrade block template in Website UI -> Global blocks -> Upgrade Access and put your token purchase link as the following: {{if !isset($smarty.get.service_id)}} <a data-href="{{$lang.urls.upgrade}}?service_id=13" data-fancybox="ajax">Get more tokens</a> {{/if}} So basically it will open the same popup, but with additional parameter to trigger specific payment processor. The {{if}} condition is needed so that this link doesn't appear when you open another instance of this popup. Quote Link to comment Share on other sites More sharing options...
snqke Posted February 16 Author Share Posted February 16 Thanks for reply , where do i need to place the text error message because i tried to find this message {{$lang.validation.common.unknown_error}} and i didn't find it into the Global block "Upgrade Access", and i'm not able to place the text message {{if $async_submit_successful=='true'}} <div class="success" data-fancybox="refresh"> {{if $smarty.session.status_id==3}} {{$lang.upgrade.success_message_premium_member|replace:"%1%":$lang.project_name}} {{else}} {{$lang.upgrade.success_message_active_member|replace:"%1%":$lang.project_name}} {{/if}} </div> {{else}} <strong class="popup-title">{{$lang.upgrade.title}}</strong> <div class="popup-holder"> <form action="{{$lang.urls.upgrade}}" data-form="ajax" method="post"> <div class="generic-error hidden"></div> {{if count($card_packages)>0}} <div class="button-group"> {{foreach item="item" from=$card_packages}} <div class="row"> <div class="toggle-button inversed {{if $item.is_default==1}}active{{/if}}" data-action="choose"> <input type="radio" class="radio" name="card_package_id" value="{{$item.package_id}}" {{if $item.is_default==1}}checked{{/if}}/> <span>{{$lang.memberzone.access_packages[$item.external_id]|default:$item.title}}</span> </div> </div> {{/foreach}} {{if count($access_codes)>0}} <div class="row"> <div class="toggle-button inversed" data-action="choose"> <input type="radio" class="radio" id="i_have_access_code"/> <span>{{$lang.signup.field_option_access_code}}</span> <script> $('#i_have_access_code').on('change', function() { $('#upgrade_access_code').val('').parent().css('display', $(this).prop('checked') ? 'block' : 'none'); }); </script> </div> </div> {{/if}} </div> {{/if}} {{if count($access_codes)>0}} <div class="row" {{if count($card_packages)>0}}style="display: none"{{/if}} data-name="payment_option"> <label for="upgrade_access_code" class="field-label">{{$lang.signup.field_access_code}}</label> <input id="upgrade_access_code" type="text" name="access_code" class="textfield" data-name="card_package_id"/> <div class="field-error down"></div> </div> {{/if}} <div> <div class="bottom"> {{if count($card_packages)>0}} <input type="hidden" name="payment_option" value="2"/> {{/if}} <input type="hidden" name="back_link" value="{{$lang.urls.payment_action}}"/> <input type="hidden" name="action" value="upgrade"/> <input type="submit" class="submit" value="{{$lang.upgrade.btn_purchase}}"/> </div> <div class="bottom"> <a data-href="{{$lang.urls.upgrade}}?service_id=12" data-fancybox="ajax" class="submit">Get more tokens</a> </div> </div> </form> </div> {{/if}} Also when i place this condition {{if !isset($smarty.get.service_id)}} <a data-href="{{$lang.urls.upgrade}}?service_id=13" data-fancybox="ajax">Get more tokens</a> {{/if}} it show for me like this Quote Link to comment Share on other sites More sharing options...
Tech Support Posted February 18 Share Posted February 18 Messages that are starting with "validation.xxx" are not used in templates directly, they are used in block PHP code based on specific rules. On 2/16/2024 at 12:33 PM, snqke said: it show for me like this Please create support ticket. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.