[Resolved] Custom hook problem

Home Forums Support Custom hook problem

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1206546
    johnaps

    Hello!

    I have used gp hooks to implement a back to shop button on cart page, because previously i disabled header and footer on cart page so it will be in “focus mode”…

    Problem is that i have used the following code only for cart page in the woocommerce_before_calculate_totals

    <button class="rbs">
    	<a href="https://sofianos-orthopedika.gr/">Πίσω στο κατάστημα</a>
    </button>
    
    <style>
    	.sfm-navicon-button.x.sf_label_default {
    		display: none;
    	}
    	@media (max-width: 768px) {
    		.rbs {
    			 width: -webkit-fill-available;
    		}
    	}
    	.rbs {
    		box-shadow: 0 0 1px 0 rgba(0,0,0,.1);
        border: 1px solid #ddd;
        transition: all 0.1s ease-in;
        border-radius: 8px!important;
        box-sizing: border-box;
    		margin-bottom: 1.25em;
    	}
    	.rbs a {
    		color: #ffffff;
    		font-size: 16px;
    		font-weight: bold;
    	}
    </style>

    and i have cleared cache and i get 2 buttons today for some reason (one where it should be up top, and one to bottom left which is weird…). This happened today, when i first implemented the hook the button was where it should be with and was just one in the entire page…
    P.S. i have also used different hook positions after seeing the problem with no luck…

    In the following image you will see the 2 buttons (green is the good one, red is the bad/weird one)

    View post on imgur.com

    #1206624
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    If you set the Hook Element to “Draft”, do both buttons disappear?

    If not, perhaps the other one is being added using a custom function or another Element?

    #1206630
    johnaps

    They do disappear both if i make it draft

    #1207213
    David
    Staff
    Customer Support

    Hi there,

    can you try this hook:

    woocommerce_before_cart

    And remove the Button element so this:

    <button class="rbs">
       <a href="https://sofianos-orthopedika.gr/">Πίσω στο κατάστημα</a>
    </button>

    becomes:

    <a class="rbs button" href="https://sofianos-orthopedika.gr/">Πίσω στο κατάστημα</a>

    #1207500
    johnaps

    That did it David! Cant understand why though but you are awesome! Keep up the good work! Thank you!

    #1208115
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.