ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Simple Commerce Module (SCM) pass variable to paypal

November 14, 2012 6:45am

Subscribe [1]
  • #1 / Nov 14, 2012 6:45am

    CHIEF

    42 posts

    Hi, I am trying to get the SCM to pass a variable to paypal. So when the user add’s to cart it can display further information about the product.  At the moment it only shows the entries {title} in the cart, id like it to show the entry date also. So in the attached image, under the “Cakes” Id like it show the entry date as well.

    My SCM code:

    {exp:channel:entries channel="london_class" dynamic="no" show_future_entries="yes"}
       
         <div id="fancy-{entry_id}" class="fancy-inner">
       
       {exp:simple_commerce:purchase entry_id="{entry_id}" currency="GBP" success="site/success" cancel="site/fail" show_disabled="no"}
      
        <h1>{title}</h1>
        
        Date & Time: <span>{entry_date format=" %j%S %F %Y"} {class_time} {if class_duration}({class_duration}){/if}</span>
        
        Class Price: <span>£{item_regular_price}</span> {if class_level}<span>| Level: {class_level}</span>{/if}
        
        Status: <span>{class_status}</span>
        
        {if logged_in && class_status =="SPACES AVAILABLE"}
        <br>
              <a href="http://{path=%22&gt{site_url}images/btn-book.png&lt/a&gt">{site_url}images/btn-book.png</a>{/if}
    
       {/exp:simple_commerce:purchase}
       
         </div>
    
       {/exp:channel:entries}

    I hope this makes sense, thanks in advance.       

  • #2 / Nov 16, 2012 9:17am

    Dan Decker

    7338 posts

    Hi Mark,

    It seems odd, but it looks like the {entry_date} variable isn’t passed to SCM. You can do a quick test by breaking this out into 2 templates, a parent and an embed:

    Parent:
    {exp:channel:entries channel="london_class" dynamic="no" show_future_entries="yes"}
       
         <div id="fancy-{entry_id}" class="fancy-inner">
       
       {embed="store/.item-detail" item_id="{entry_id}" item_date="{entry_date format=' %j%S %F %Y'}"}
       
         </div>
    
       {/exp:channel:entries}
    
    ...and the embedded template:
    {exp:simple_commerce:purchase entry_id="{embed:item_id}" currency="GBP" success="site/success" cancel="site/fail" show_disabled="no"}
      
        <h1>{title}</h1>
        
        Date & Time: <span>{embed:item_date} {class_time} {if class_duration}({class_duration}){/if}</span>
        
        Class Price: <span>£{item_regular_price}</span> {if class_level}<span>| Level: {class_level}</span>{/if}
        
        Status: <span>{class_status}</span>
        
        {if logged_in && class_status =="SPACES AVAILABLE"}
        <br>
              <a href="http://{path=%22&gt{site_url}images/btn-book.png&lt/a&gt">{site_url}images/btn-book.png</a>{/if}
    
       {/exp:simple_commerce:purchase}

    Can you run that test for me and let me know the results?

    Thanks!

  • #3 / Nov 19, 2012 7:51am

    CHIEF

    42 posts

    Hi Dan, thanks for your response.

    I have created two templates as above. however none of the entry custom fields are working, only the {entry_date} and SCM fields are showing.

    When I click on add to basket, the entry date is not showing n the paypal age either.

  • #4 / Nov 21, 2012 6:54am

    CHIEF

    42 posts

    Any ideas? Thanks

  • #5 / Nov 21, 2012 12:37pm

    Dan Decker

    7338 posts

    Hi Mark,

    ...however none of the entry custom fields are working…

    Only what you pass through with an embed variable will be available in the embedded template. Custom fields are automatically passed to the child template.

    Do you have this on a server we can access? I’d be a better experience for you if we could come in for a look. Keep an eye out for an email from EllisLab.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases