Announcement

Collapse
No announcement yet.

Using a Javascript variable as the Actinic price

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

    Using a Javascript variable as the Actinic price

    Hi,

    The page I'm working on (http://www.operationagri.org.uk/acat...alculator.html) uses a Javascript function to calculate the price.

    I'd like to use this value as the 'Price' in Actinic, so that people click on 'Add to Cart' with that value turning up in the basket in the usual way, but can't work out how to do this.

    I get the value into the body of the three test products by:
    1. Put the calculated cost into document.getElementById("co2_cost_hydro_id").firstChild.nodeValue, for the first case.
    2. In the body have 'Cost to offset = £!!<<a id="co2_cost_hydro_id">>!!0.00!!<</a>>!!.'

    But I can't use this in the 'Price' box because it's too long.

    All suggestions welcome - I'm very new to all this, as I'm sure you can tell.

    Malcolm Drummond

    #2
    Sorry, probably should have mentioned that I'm using 9.0.2.0.0.0.IERA.

    Malcolm

    Comment


      #3
      This can only be done using quite sophisticated patches to ShoppingCart.pl, Cart.pm, ActinOrder.pm and possibly CartManager.pl and OrderScript.pl. Likely to be way, way beyond the level off free support provided by this forum.

      I've been commissioned to do this sort of thing before so get in touch if you cannot proceed. It took me many weeks going through the 800+ Kb of Perl mentioned above to get the required knowledge so it's a bit of a trade secret for me and I'm not going to post it here.

      The quick and dirty fudge would be to have a product priced at £1 (or perhaps 10p) and buy it in multiple quantities by manipulating the product quantity field. You'd be stuck with pricing to the nearest pound (or 10p) this way, however. And might still need to patch ActinicOrder.pm to prevent the quantity being alterable in the Cart. The cart would look a bit confusing too with a big number in the quantity field. Note that the maximum quantity allowed is 32767.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Hi, Norman,

        Many thanks for your reply. At least I don't feel so bad about not being able to figure it out myself!

        Malcolm
        Operation Agri

        Comment

        Working...
        X