Jump to:

23368 Posts in 18143 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Concrete5 --> SilverStripe || MODX?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 4976 Views
  • neilcreagh
    Avatar
    Community Member
    90 Posts

    Re: Concrete5 --> SilverStripe || MODX? Link to this post

    Hi Chris,

    I'm just installing the FoxyCart module and I have a few questions - like where do I enter the API key? Is there any kind of documentation you could point me towards, or could you outline the initial set-up steps? Thanks, Neil

  • Chris_Bryer
    Avatar
    Community Member
    35 Posts

    Re: Concrete5 --> SilverStripe || MODX? Link to this post

    Hey Neil,
    sorry, i am lacking in documentation, but feel free to ask whatever you need here.
    once you set the store name, i believe it should work well.
    you would set the params in mysite/_config.php.

    // set your store name ( myStoreName.foxycart.com would = myStoreName).
    Foxycart::setFoxycartStoreName('myStoreName');

    // set the API Key
    // foxycart would then send the datafeed to www.yoursite.com/order-collection
    Foxycart::setStoreKey('ABCDEFG1234567890');

    you can decorate FoxyCartDataFeedCollector to do whatever you want with the data. here's an example of how you could send the information out to another service for something like order fulfillment:

    //in mysite/_config.php:
    Object::add_extension('FoxyCartDataFeedCollector', 'Dispatcher');
    Dispatcher::setURL('https://website.com');

    // in Dispatcher.php
    class Dispatcher extends DataObjectDecorator {
       static $url;
       
       public function setURL($u){
          self::$url = $u;
       }
       
       public function DispatchData($data){
          if($data){
             $ch = curl_init();
             curl_setopt($ch, CURLOPT_URL, self::$url);
             curl_setopt($ch, CURLOPT_POST, 1);
             curl_setopt($ch, CURLOPT_POSTFIELDS, array("FoxyData" => urlencode($data)));
             curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
             $response = curl_exec($ch);
             curl_close($ch);
             
             return $response;
          }
          return 'no data';
       }

    public function handleDecryptedFeed($encrypted, $decrypted){
       //do what you want to with encrypted & decrypted data
          self::DispatchData($encrypted);
    }
    }

    i hope it helps, please let me know how it goes, and if you have any recommendations.
    -Chris

  • neilcreagh
    Avatar
    Community Member
    90 Posts

    Re: Concrete5 --> SilverStripe || MODX? Link to this post

    Thanks Chris.
    When I set the API key in FoxyCart do I need to set the "customer password hash type" and if so, which setting is right?
    And should "enable cart validation" be ticked or unticked?

    Also, and I don't think this has anything to do with settings for your module so feel free to ignore this question, but do you have any idea why Foxycart would give me a warning about my CSS file when I cache my template URL for Cart/Checkout when my CSS file is only referencing cached images like so:


    But the warning still says "A reference to a non secure css file was found"

    Thanks!

  • ChrisBryer
    Avatar
    Community Member
    95 Posts

    Re: Concrete5 --> SilverStripe || MODX? Link to this post

    you dont need to turn on customer password hash type. its mainly for sharing users. i never had to do that so i havent built a connector, but its nice that its possible. the module doesnt support cart validation right now either. its an anti-spoofing method to prevent people from changing prices in firebug before buying stuff, and i've never had anyone thats done that.

    for the warning, its saying your'e trying to pull an image from http in an https environment, and the background image is looking for http://www.MYSTORE.com/themes/MyTheme/images/topbar.gif (non https).

    ive never had to point to the foxycart cache in my css though, foxycart has always seemed to crawl relative urls, rewrite the links and import the images to their own environment.. so for example, in my css, i would write:

    background-image: url(../images/topbar.gif);


    foxycart then finds the images and pulls them into their environment, pulls the html into their environment and rewrites the links.

    -Chris

  • neilcreagh
    Avatar
    Community Member
    90 Posts

    Re: Concrete5 --> SilverStripe || MODX? Link to this post

    Makes sense, thanks Chris - great work!

    4976 Views
Page: 1 2
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.