We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26931
    • 2,314 Posts
    How to switch Shopkeeper config so that it uses the non-Russian language files?
    ah, okay...the module actually uses the language that is set for the MODx manager (tools -> configuration) -> looking at the module code (default is russian):
    $manager_language = $modx->config['manager_language'];

    for the cart itself, there’s a language parameter
    maybe add your french language files to the lang-folder, clear the cache and see if it works (or set your manager to english)
      • 18913
      • 654 Posts
      The calls I have on my testbed shopkeeper order form are :

      [!Shopkeeper? &lang=`en` &currency=`USD` orderFormPage=`XY`&gotoid=`AB` &changePrice=`1`&counterField=`1`!]
      [!eForm? &formid=`shopOrderForm`&tpl=`shopOrderForm`&report=`shopOrderReport`&vericode=`1`&ccsender=`1`&gotoid=`AB`&subject=`SHK order`&eFormOnBeforeMailSent=`populateOrderData`&eFormOnMailSent=`sendOrderToManager`!]


      Note the language and currency flags.

      On the template for the product pages it is
      [!Shopkeeper? &lang=`en` &currency=`USD` &cartType=`small` &orderFormPage=`XY`&gotoid=`AB`!]


      XY and AB are the document IDs of the order form page and the thank you page, respectively.
      I haven’t looked into the language code logic. My fear would be that so far, only English and Russian are dealth with??
      Hope this helps,
      MattC
        • 18913
        • 654 Posts
        I have redone an installation of Shopkeeper and then setup a sample store. Notably, I think I kept half-decent notes and here they are, albeit a bit rough to read. The order in which I created things is not the same as in the demo. To my mind, this ordering seemed to make a bit more sense.
        Please advise of errors, improvements, etc.
        Hope this helps,
        MattC

        ====== GET SOME SAMPLE IMAGES ==============================
        Go to
        http://wdevblog.net.ru/shopkeeper
        or
        http://www.kunane.com/modx/shopkeeper.html
        and save the images of products to use as test material. I’m going to use three.
        ====== CREATE AN ORDER FORM DOCUMENT =======================
        Name this
        Order Form
        with an alias of
        orderform
        Make sure it is *not* checked for being shown in the menu. Make sure it is published and is not using the rich text editor. Assign it to a new category, for example "shopkeeper". For a template, I used the minimal template provided with MODx. Save it, noting it’s document ID.

        Return to editting this document. For it’s content enter the following :
        [!Shopkeeper? &lang=`en` &currency=`USD` orderFormPage=`[*id*]`&gotoid=`AB` &changePrice=`1`&counterField=`1`!]
        [!eForm? &formid=`shopOrderForm`&tpl=`shopOrderForm`&report=`shopOrderReport`&vericode=`1`&ccsender=`1`&gotoid=`AB`&subject=`SHK order`&eFormOnBeforeMailSent=`populateOrderData`&eFormOnMailSent=`sendOrderToManager`!]

        (If you’re cutting and pasting, watch out for the carriage returns)
        Save the document.
        (After we create the thank you page, we will return here and replace AB with the document id of that page.)
        ====== CREATE A THANK YOU DOCUMENT =========================
        Do the same thing for a "Thank You" page as was done for the Order Form page. "Thank you" is the title and the alias is thankyou. It should not be visible in the menu and it should be published. Assign it to the shopkeeper category.

        Enter the following for the time being in its content area :
        <p><strong>Thank you for your order!  </strong></p>
        <p>We'll be in touch shortly...</p>
        

        Save the document, noting it’s document ID. Return to editing the content of the order form page and update the AB values with this number.
        ====== CREATE TEMPLATE PAGE(S) FOR THE PRODUCTS ============
        Create a new template which will serve as the page template for each product :
        Elements -> Manage Elements -> Templates
        Select New Template
        OR
        Duplicate an existing template. In either case, give it a unique name and assign it to the new category, which we’ve called here "shopkeeper". (The purpose of the category is to help keep things
        organized). Obviously, different types of products can have different types of templates. But for each, we will want a link to the shopping cart. So add this to each page’s content, perhaps
        in the header or footer or a sidebar :

        [!Shopkeeper? &lang=`en` &currency=`USD` &cartType=`small` &orderFormPage=`XY`&gotoid=`AB`!]


        where XY is the document ID of the order form page created above and AB is the document ID of the thank you page created above.

        Below the content tag add this line :
        {{shopToCart}}

        This will enable us to have an "Add to Cart" button on the product page itself.

        FWIW, the styling for the cart may be found in the file
        style.css
        in the shopkeeper folder

        (For example changing the margin from 10px 0 to 10px 10px
        on line 17 narrows the cart box.)
        ======= CREATE TEMPLATE VARIABLES FOR THE PRODUCT PAGES ===========
        Now, back in the Manager view, go to
        Resource -> Manage resources -> Template variables
        Select
        New template variable
        name it
        price
        with input type being Number, and associating it with the template(s) created above
        under "Template Access" Also, select "shopkeeper" for its category. Save this variable.

        Do the same for a template variable named
        image
        Under caption, put
        image
        and select as an input type
        Image
        Also, assign it to the template(s) created above and use "shopkeeper" as a category. Save the variable.

        ========== CREATE A PAGE TO SHOW A SUMMARY OF PRODUCTS =========
        Create a new document. It too can be associated with a template, but we’ll want to have it’s contents
        be a Ditto call. In the template you select, place this call somewhere (e.g. top of the sidebar)
          [!Shopkeeper? &lang=`en` &currency=`USD` &cartType=`small` &orderFormPage=`XY`&gotoid=`AB`!]

        in order to see the cart.
        For a title, I used "Catalog Page" and for an alias I entered "catalog" Now, select the Page Settings
        tab and make sure that the "Published" button is selected and that it is marked as a container. You may also want to turn off the rich text editor. Place the following call call in it’s content area :
          [!Ditto? &parents=`[*id*]`&tpl=`shopStuff`!]

        Save the document
        ========= CREATE PAGES FOR EACH PRODUCT ===============
        Right click on the "Catalog Page" document and select
        Create resource here.

        In the "General" tab of the form that opens up, give the new document the title
        Mouse

        and create an alias such as "mouse." (I used images from the Russian demo site)

        In the Summary/introtext box, type some text, such
        as:
        Computer Mouse "Mickey Mouse" - the best gift to the system administrator!

        Now, in the document content box - and using the TinyMCE editor - select Insert image. A dialogue box will come up and you will need to browse for the image you downloaded, upload it to the image folder, then select it. In the next dialogue box, select "Insert". Don’t bother with a description.

        In the same content box, underneath the image, enter more descriptive text.

        At the bottom of the page, under template variables,select "insert" next to the image variable and select
        the same photo as uploaded above.

        Also add a price.

        Go to the "Page Settings" tab and make sure the document
        is published.

        Save the item.

        Repeat the above steps for the Keyboard and Mousepad.
        ========== CREATE THE SHOPKEEPER MGMT MODULE =================
        Returning to the manager, select
        Modules -> Manage Modules
        and then
        "New Module"

        Name the module
        Shopkeeper
        and give it a short description.

        For it’s code, copy the contents of the
        Shopkeeper_module.php
        file found in the main folder into the Module code
        box.

        Assign it to the shop category.

        Save the module.

        Refresh the manager page and "Shopkeeper" should now show up as a selection under the "Modules" section.

        Click on the button to the left of the Shopkeeper entry and select Run module. At this point, select install. (One will see a refresh and configuration option, with no orders present.)
        ====================== CREATE CHUNKS ==================
        Using the text provided in the install/examples/en folder
        create the chunks, assigning them to the shopkeeper category.
        ====================== CREATE SNIPPETS ================
        Using the text provided in the install folder, create
        the two snippets - Shopkeeper and SHKwidget - assigning
        them to the shopkeeper category as well.

        ====================== Test Drive =====================
        If mail is enabled, one should by now be able to preview
        the catalog page, select a product, and submit
        an order. Incorrectly entering the confirmation code
        should generate a short two line error message below
        the shopping cart. Correctly entering the code
        should bring up the thank you page.)

        Now return to the Shopkeeper module under the Modules
        page of the manager view.

        Selecting refresh should show the orders so far received.

        We’ll tackle adding the widget later...
          • 15001
          • 697 Posts
          Thanks. Sorry that I did not see your answer before, but I had a glance at the code yesterday and could find what I was doing wrong: mistake in language file names.

          In my case, the manager language is "Francais". So, I had to use "francais.php" file. Previously, it was named "french.php", so Shopkeeper could not find it and switched to its default language (Russian). You never met this problem if you were using Shopkeeper in English.

          The "russian.php" file name (itself named in English) is the cause of my initial mistake.
            • 18913
            • 654 Posts
            I’m trying to link the payment gateway class found here
            http://www.phpfour.com/blog/2009/02/php-payment-gateway-library-for-paypal-authorizenet-and-2checkout/
            to the Shopkeeper routine and am not making the progress I thought I would. I’m hoping someone here can help.

            The above payment class and sample code works fine on its own. (At least the Paypal part does - I haven’t tried the other two.) What I want to do now is handoff the info from Shopkeeper to this code. I thought I could add the code found in paypal_start.php to the bottom of the Shopkeeper routine sendOrderToManager. But all that happens is I get immediately redirected to my "Thank you" page.

            If I instead put the paypal_start.php sample code in its own snippet and then place a call to that after the eForm call on the order form page, I never get to complete the eForm and am pushed along to the Paypal page.

            Clearly, there’s something I don’t appreciate about the way program control is handled and I’m wondering if anyone has any ideas? It would seem to me that if this class can be made to work then in fairly short order there ought to be a couple of payment gateways available to Shopkeeper.
              • 18913
              • 654 Posts
              I think I’ve gotten it to work. By putting the sample code in it’s own snippet and putting that in a document, I can then use that document ID in the eForm call as the parameter for "gotoid". That does send me over to the Paypal site with the relevant info. At least in a first test.

              This doesn’t feel like it’s either the most elegant or secure way of accomplishing this, but it’s a start.
              MattC
                • 22574
                • 181 Posts
                Hey Guys I am trying to get the SHK widget part to work but its making my list disappear?

                I made a TV with all my colours in it, then I made the SHKwidget snippet and added the call [[SHKwidget? &docid=`[+id+]`&format=`select`&tvname=`colour`]] to my product chunk.

                Is there a step I missed?

                Cheers
                  • 18913
                  • 654 Posts
                  Hi,
                  Here’s what I did.
                  - made TV of type Text and named it param1
                  - assigned it to the template used for the product detail pages
                  -In the content area for the product for which I want the options shown, I
                  put this code :
                  [[SHKwidget? &docid=`[*id*]`&format=`select`&tvname=`param1`]] 

                  -While still on the product detail page, I entered the following in the field
                  assigned to param1 :
                  ==||Gift wrap==3.50||Gift bag==5.00


                  In your case, it looks like you used "+id+" instead of "*id*".

                  Does that help any?
                  UPDATE : By the way, I also uploaded the SHKwidget ditto extender (found in at least the latest release) and changed by Ditto call (on the catalog page) to
                  [!Ditto? &parents=`[*id*]`&tpl=`shopStuff`&extenders=`SHKwidget`&wtTVname=`param1`&wtFormat=`select`!]


                  The shopStuff chunk was editted to include this line :
                  <div>[+param1+]</div>

                  and the shopToCart chunk was editted to include this line :
                  [*param1*]


                  MattC
                    • 22574
                    • 181 Posts
                    Thanks mconsidine that worked a treat,

                    Is there a way to set the tv as a list so that the user doesn’t have to copy an past 10 colours into each product page tv?
                      • 18913
                      • 654 Posts
                      How about setting the TV’s default value to be that list? Haven’t tried it yet, but will ...
                      MattC