Announcement

Collapse
No announcement yet.

Adding item to cart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding item to cart

    Hi

    I have been looking at the ca000001.pl Perl script that add item to the cart. It only needs the PLU no and the section no. The PLU is easy but the section no is more tricky as it comes from/with the Online_Catalog_<section_Name>_<section_no>.html files when (?) they are built.

    Q:
    Is there a way to add item to the cart without the section no?
    Is there a way to prevent Actinic changing the section no (sometimes) after each (import/replace &) refresh?

    Thanks in advance

    C

    #2
    As far as I understood you want to add products straight to the basket. If so then probably http://community.actinic.com/showthr...?threadid=1905 seeds some more light into the issue.
    Is there a way to add item to the cart without the section no?
    The section ID is required to find the section blob (.cat file) where the product details are kept. So this parameter is mandatory for the script. However there can some tweaks be applied to get rid of this requirement. The cart script can be modified to use Cart::LookUpSectionID function when $::g_InputHash{SID} is not defined (this is not done by default due to performance reasons). So you can get this work with a minimal perl knowledge.

    Good luck.
    Zoltan
    Actinic Software
    www.actinic.co.uk

    Comment


      #3
      Hi Zoltan,

      Can you throw any more light on this solution? Perhaps an example?

      Many Thanks
      Andy

      Comment


        #4
        The SID parameter should be the section ID of the section where the product can be found. You can figure out the exact SID by checking the HTML source of the product page (look for <INPUT TYPE=HIDDEN NAME="SID" VALUE="xxx"> where xxx will be the section ID).
        Bruce King
        SellerDeck

        Comment


          #5
          Hi Bruce,

          I'm not interested in an HTML output/manual collection of SID numbers.

          I would like an example of a programmatic solution as Zoltan mentioned above using PERL "The cart script can be modified to use Cart::LookUpSectionID function when $::g_InputHash{SID} is not defined" if possible.

          The solution, hinted at above, seems to be what I'm after and I was looking for someone who is more familiar with perl/actinic to point me in the right direction with the modification outlined above.

          Thanks

          Comment


            #6
            Have a look in ShoppingCart.pl (this is the full source that ca000001.pl is generated from). There is a main dispatch routine that calls various modules depending on the Shopping Mode (Quantity on Product Page, Quantity on Confirmation Page, etc). Trace through the one you're using and look for the test for the passed in SID parameter. Modify this code to use the Cart::LookUpSectionID (passing it the Product Reference) if the SID isn't found in the input hash.

            Cart::LookUpSectionID is defined in Cart.pm where you'll find it well commented.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              And another way would be to create a Custom Property called (say) SID. Set it to the Actual SID value for every product.

              If you know Access you could set this value automatically by looking in the ProductProperties table and use an update query to set it to the nParentSectionID in the Product Table (using the sProductRef in ProductProperties to match against Product reference in the Product table).
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Thanks Norman,

                That will give me enough to go on I think.

                Many Thanks

                Comment

                Working...
                X