0

We are using PWA venia theme 2.4.5. We are trying to add a button below ADD TO WISHLIST in PDP Page

We tried the below code . but we are not seeing any button.

{
  isMobile && (
    <div className={classes.cartActionButton}>
      <div className="px-3 h-[46px] m-auto w-full">
        {cartActionContent}
        <Suspense fallback={null}>
          <WishlistButton {...wishlistButtonProps} style={{ color: "red" }} />
        </Suspense>
        <button type="button">Custom button</button>
      </div>
    </div>
  );
}

Here is ProductFullDetail.js : https://pastebin.com/YBD5f5bG

3 Answers 3

1
+50

Here I have added a button code placed after WishlistButton button code line no. 984 into your file

<button
    className="custom-button"
    style={{
        background: linear-gradient(90deg, rgb(199, 164, 111) 0%, rgb(136, 108, 68) 100%);
        width: 100%;
        height: 40px;
        border-radius: 5px;
        color: rgb(255, 255, 255);
        letter-spacing: 4px;
        position: relative;
        top: 10px;
        justify-content: center;
    }}
>
    Custom Button
</button>

and remove this button code from line no. 1032

<button type="button">Click Me</button>

please add this code and try to add code.

7
  • thankyou, i will check it Commented Jan 23 at 12:13
  • please remove the style tag and after check Commented Jan 23 at 12:26
  • link please check Commented Jan 23 at 12:33
  • apply the same code to the 1034 line where you can remove the first code so this is working on mobile also Commented Jan 23 at 12:37
  • added the code. it's visible initially and disappearing after the page load completely. is that the css issue ? Commented Jan 23 at 12:43
0

You can find the {cartActionContent} code in your ProductfullDetail.js

and then add the code below like :

{cartActionContent}
<Suspense fallback={null}>
   <WishlistButton {...wishlistButtonProps} />
</Suspense>

enter image description here

1
  • i am already using the same code [wishlist button is already there ] , can you please tell what new code i need to add for new button ? I want the custom button below the wishlist button. Commented Jan 23 at 9:46
0

Try replacing :

<button type="button">Custom button</button>

to

<LinkButton
    className={
        ' max-h-[35px] py-2 focus:outline-none'
    }
    onClick={() =>
        alert('test');
    }
>
    <ChevronRight
        size={20}
        className="rounded-full border border-[#C77F44] text-[#C77F44]"
    />
</LinkButton>

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.