Jump to:

2082 Posts in 1002 Topics by 452 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » How to override certain functions

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 969 Views
  • Jatinder
    Avatar
    Community Member
    23 Posts

    How to override certain functions Link to this post

    Hello,

    How do I override certain functions in e-commerce module without modifying the core files?

    To be specific, I want to override the "AllowPurchase" and "addToCart" functions in Product.php

    Thanks,
    Jatinder Singh Thind

  • Rodolfo
    Avatar
    Community Member
    11 Posts

    Re: How to override certain functions Link to this post

    Hi Jatinder,

    Did you find a way to solve this?

    Regards,
    Rodolfo

  • Jedateach
    Avatar
    Forum Moderator
    227 Posts

    Re: How to override certain functions Link to this post

    Hi guys,

    AllowPurcahse on Product class has been deprecated, and replaced with canPurchase a while back.

    You should be able to override / modify this function by creating an extension of Product that implements the canPurchase function. See silverstripe documentation on how to create extensions.

    regards,
    Jeremy

    969 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.