SStokes Posted September 10, 2023 Posted September 10, 2023 Hi All, I need a previous next button on the product page to go from one product to the next. Has anyone done this? I knew how to do it Osc 2.3 but I don't know how to do it on OSC 4 Quote
SStokes Posted September 15, 2023 Author Posted September 15, 2023 I found the following code in the admin section but I am not sure how to implement it <div class="w-prod-page after w-or-prev-next"> {if isset($app->controller->view->product_prev) && $app->controller->view->product_prev > 0} <a href="{$app->urlManager->createUrl(['categories/productedit', 'pID' => $app->controller->view->product_prev])}" class="btn-next-prev-or btn-prev-or" title="{$app->controller->view->product_prev_name}"></a> {else} <a href="javascript:void(0)" class="btn-next-prev-or btn-prev-or btn-next-prev-or-dis" title=""></a> {/if} {if isset($app->controller->view->product_next) && $app->controller->view->product_next > 0} <a href="{$app->urlManager->createUrl(['categories/productedit', 'pID' => $app->controller->view->product_next])}" class="btn-next-prev-or btn-next-or" title="{$app->controller->view->product_next_name}"></a> {else} <a href="javascript:void(0)" class="btn-next-prev-or btn-next-or btn-next-prev-or-dis" title=""></a> {/if} $(document).ready(function(){ const prevNextTop = $('.w-or-prev-next').offset().top; const $btnNextPrev = $('.btn-next-prev-or'); btnNextPrevPosition(); $(window).on('scroll resize', btnNextPrevPosition) function btnNextPrevPosition(){ let top = $(window).height() / 2 + $(window).scrollTop() - prevNextTop; $btnNextPrev.css('top', top) } $('.btn-prev-or, .btn-next-or').click(function(e){ $(this).attr('href', $(this).attr('href')+window.location.hash); }) $(".check_bot_switch_on_off").tlSwitch( { onText: "{$smarty.const.SW_ON}", offText: "{$smarty.const.SW_OFF}", handleWidth: '20px', labelWidth: '24px' } ); Quote
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.