Problems, need help? Have a tip or advice? Post it here.
30 posts Page 1 of 3
OKay i've been working with the store template to try and gain some ideas. the plan is to run a databound form to submit data onto this online store. However it'll not just be me who will be submitting the data it'll be my registered members. So when they submit a product, they also submit their Paypal account for use when buying. So when a user buys a product how can i link that product with the person selling that item.



Linking Paypal with users posts
So for example. Lets say user seller posts up their product. They link there paypal account to be paid into.

Now then lets say buyer comes along and sees seller's product. Adds this to his shopping cart and then goes to check out. So when he checks out it'll show sellers paypal email to then buy that item. Rather than paying into my account as the owner of the website it'll pay into the seller account.


The Amount instock
Next would be setting the amount the seller has. So some sellers only have one item of it, or some sellers may have 20. So within the index clone page a custom field lets say we have amount, so set as 20 items, now lets say 10 are sold, that means only 10 are left in stock. Once the item hits 0, it'll instead of add to cart it'll say sold out. and the buyer cant buy this item. So if a seller only has 1item, then once that item is sold it'll have a 0 setting so that means it'll set as sold out. Once the item is sold out it'll remove the clone page.

Submitting databound (Paypal payment)
I also want to at some point add in a cost for subbmitting a databound form, product to my website. So the user will need to have an account to submit data, once within that databound form before submitting i want like a cost ''So lets say £1.50" to be paid to my paypal account before it's aloud to be submitted. Any ideas?
databound expired date
With the top above regarding payment for databound i also want to set a expired date too. So lets say the user is submitting a databound and willing to pay the fee, it'll set a expired date, so lets say todays date is 21/11/2015 and after 4days it'll expire. so if its after that date it'll say ended within the product at it cant be brought.

i also want it so they can only add one item to their shopping cart and not multiple?

Any ideas
SimonRLM wrote:
Linking Paypal with users posts
So for example. Lets say user seller posts up their product. They link there paypal account to be paid into.


You can add an editable region, for the seller to put his paypal account, and show it with cms:show. So buyer can direct send a payment on the seller paypal. I never use paypal before, is it come with reporting? i mean, the buyer info, when he pay, date and time, and custom information? If no, you can make a reporting system on the seller profile page, like :

- The amount of pay (editable text)
- Time and date (date picker)
- Link of the ads (via cms:show k_page_link)
- Custom notes (editable textarea)

And send it via cms:sendmail, that collect information via seller profile.
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
Hi, Simon. I run a website for a national charity with multiple chapters. Donations through the site can be made to the national organization or directly to individual chapters. Many of the chapters have their own PayPal account. So when someone makes a donation to a chapter, a simple JS script switches the merchant ID on the form to the appropriate chapter's ID, and funds are paid directly into that chapter's PayPal account.

It's very easy. However, I'm not using Couch Cart. It's purely a custom set up. I don't know if it would translate to the Couch implementation. I think with Couch you set up your PayPal credentials in the Couch config file. Not sure if it would support being changed in the same way.

Anyway, let me know if you want more details on how it's done, but like I said It's not a Couch Cart thing. It simply changes the value of the "business" field on the PayPal form. BTW, I would recommend using a person's merchant ID rather than their email address. It's perfectly secure to use and doesn't expose their email address on the open web.

That's one idea. As far as an expiration date, try following this thread and the one it links to. It describes setting an expiration date on blog pages, and might suit your needs. viewtopic.php?f=4&t=8584

When it comes to accepting payment to enable privileges, you'll need to do some programming to set that up. This isn't something Couch has pre-packaged for you. I think PayPal's IPN is going to be involved. Generally, you need to set up a script that "listens" for a ping from PayPal saying payment is complete. That script then takes some action, in this case granting the necessary privileges.

I found this script very useful for getting to know PayPal's IPN: http://www.micahcarrick.com/paypal-ipn-with-php.html
tim wrote: Hi, Simon. I run a website for a national charity with multiple chapters. Donations through the site can be made to the national organization or directly to individual chapters. Many of the chapters have their own PayPal account. So when someone makes a donation to a chapter, a simple JS script switches the merchant ID on the form to the appropriate chapter's ID, and funds are paid directly into that chapter's PayPal account.

It's very easy. However, I'm not using Couch Cart. It's purely a custom set up. I don't know if it would translate to the Couch implementation. I think with Couch you set up your PayPal credentials in the Couch config file. Not sure if it would support being changed in the same way.

Anyway, let me know if you want more details on how it's done, but like I said It's not a Couch Cart thing. It simply changes the value of the "business" field on the PayPal form. BTW, I would recommend using a person's merchant ID rather than their email address. It's perfectly secure to use and doesn't expose their email address on the open web.

That's one idea. As far as an expiration date, try following this thread and the one it links to. It describes setting an expiration date on blog pages, and might suit your needs. viewtopic.php?f=4&t=8584

When it comes to accepting payment to enable privileges, you'll need to do some programming to set that up. This isn't something Couch has pre-packaged for you. I think PayPal's IPN is going to be involved. Generally, you need to set up a script that "listens" for a ping from PayPal saying payment is complete. That script then takes some action, in this case granting the necessary privileges.

I found this script very useful for getting to know PayPal's IPN: http://www.micahcarrick.com/paypal-ipn-with-php.html



The main goal is setting everything to be easy as a buyer. So PayPal is my option to use. It'll be a selling website so a user will submit his product with his paypal link Id. Then the buyer will come along and buy the product and pay via PayPal.

I don't really need couch cart to run this. So it'll have a buy now button on the product for sale. It'll then link to the sellers PayPal account. So when the buyer comes along and presses buy now, it'll take them to PayPal payment. Which will have all the details like

Product title so page title
Amount to pay

Just like the cart does. You can view the demo of the cart online. It's the couch cart
http://www.couchcms.com/demo/simple/

So just like that Tim, when you hit checkout...but rather than the set PayPal email the sellers PayPal email or I'd. Let me know what I can do, either posting or via message.
Hey all, back in the office again.

So i've been working out how to get the email address to be sent to paypal rather than the 'business' one or my one. So basically the sellers ID so i can have the customer pay directly to them and not me.

Okay so far i'ved worked out that itll use this code upon checkout.

Code: Select all
<cms:form method="post" anchor='0'>
                        <cms:if k_success >
                            <cms:pp_payment_gateway
                                shipping_address="<cms:if "<cms:pp_count_shippable_items />" >1<cms:else />0</cms:if>"
                                empty_cart='0'
                               
                            />
                        </cms:if>
                        <div class="checkout-box">
                            <cms:input name="paypal" class="button checkout-button" type="submit" value="Continue to PayPal" />
                        </div>
                    </cms:form>


and within the config file it'll use

Code: Select all
    // Email address of your PayPal 'business' account selling the item
    define( 'K_PAYPAL_EMAIL', 'seller_1272492192_biz@gmail.com' );



Now within the code above i need to change it to a custom editable named pp_email
I've tired to add

Code: Select all
pp_payer_business_name custom='<cms:show pp_email />'


However that'll not work.
Ok, Simon. I think I get it now. But I'm still a little bit confused because you say you don't need Couch Cart, but still seem to be trying to rely on the built in PayPal functionality in Couch. What you're suggesting is well beyond what Couch intended with it's PayPal implementation and I think you'd be better off setting it aside and rolling your own.

PayPal's JavaScript buttons seem to be well suited to your idea. (https://github.com/paypal/JavaScriptButtons) You download a script to your site then add a bit of Javascript to create Buy Now, Add to Cart, and other buttons on the site. For instance:
Code: Select all
<script async src="paypal-button.min.js?merchant=YOUR_MERCHANT_ID"
    data-button="buynow"
    data-type="form"
    data-name="My product"
    data-amount="1.00"
></script>

Such a button would be very easy to populate using Couch editable regions. When someone registers for the site, I would ask for their merchant ID as part of their user profile. A clonable template would serve to hold their product info that they would add through a DBF. The front end would display the JS button populated with the product details.
Code: Select all
<script async src="paypal-button.min.js?merchant=<cms:show merchant_id/>"
    data-button="buynow"
    data-type="form"
    data-name="<cms:show product_name/>"
    data-amount="<cms:show product_amount/>"
></script>

The buttons allow for more data and options than shown in just this simple example. What do you think?
I know my idea about using PayPal's JavaScript buttons is pretty far off on a tangent. It's just an idea.

As far as the code you posted above, trying to change the pp_payer_business_name variable is a dead end because that variable is returned after payment is made and PayPal returns payment verification to your page.

Scanning the code in the cart add-on, I'm not sure there's any way to change that seller email without messing around in the original code. The way it works, there's no way to affect it from the outside.
Just wondering if we can change value on "couch/tags.php" :
Code: Select all
// Paypal does not support zero cost transactions. Don't display buttom if amount not given.
            if( $amount ){
                if( K_PAYPAL_USE_SANDBOX ){
                    $paypal_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
                }
                else{
                    $paypal_url = 'https://www.paypal.com/cgi-bin/webscr';
                }

                if( !$image ) $image=0;
                if( $FUNCS->is_natural($image) ){
                    $arr_btns = array( 'x-click-but23.gif','x-click-but9.gif', 'x-click-but01.gif',
                                      'x-click-but3.gif', 'x-click-butcc.gif', 'x-click-but5.gif',
                                      'btn_buynow_SM.gif', 'btn_buynow_LG.gif', 'btn_buynowCC_LG.gif' );
                    $image_src = 'https://www.paypal.com/en_US/i/btn/'.$arr_btns[$image];
                }
                else{
                    $image_src = $image;
                }

                $html .= '<form action="'.$paypal_url.'" method="post">';
                $html .= '<input type="hidden" name="cmd" value="_xclick"/>';
                $html .= '<input type="hidden" name="business" value="'.K_PAYPAL_EMAIL.'"/>';
                $html .= '<input type="hidden" name="item_name" value="'.$item_name.'"/>';
                $html .= '<input type="hidden" name="item_number" value="'.$item_number.'"/>';
                $html .= '<input type="hidden" name="amount" value="'.$amount.'"/>';
                $html .= '<input type="hidden" name="undefined_quantity" value="1"/>';
                //if( strlen(trim($downloads)) ){
                if( !$show_shipping ){
                    //don't prompt customer for shipping address if product is downloadable
                    $html .= '<input type="hidden" name="no_shipping" value="1"/>';
                }
                $html .= '<input type="hidden" name="no_note" value="1"/>';
                $html .= '<input type="hidden" name="currency_code" value="'.K_PAYPAL_CURRENCY.'"/>';
                $html .= '<input type="hidden" name="rm" value="2"/>';
                $html .= '<input type="hidden" name="custom" value="'.$custom.'">';
                $html .= '<input type="hidden" name="return" value="'.$return_url.'"/>';
                $html .= '<input type="hidden" name="cancel_return" value="'.$cancel_url.'"/>';
                $html .= '<input type="hidden" value="'.$notify_url.'" name="notify_url"/>';
                $html .= '<input type="image" border="0" alt="Make payments with PayPal - it\'s fast, free and secure!"';
                $html .= ' name="submit" src="'.$image_src.'"/>';
                $html .= '<img width="1" height="1" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" alt=""/>';
                $html .= '</form>';

            }


Curious with this line : "$html .= '<input type="hidden" name="business" value="'.K_PAYPAL_EMAIL.'"/>';"

and this line : "$html .= '<input type="hidden" name="return" value="'.$return_url.'"/>';"


If it can be modified, or maybe make form to mimic that default couch code, so you can put a user pp email, and provide the return url.

Just wondering, still need KK to confirm it.
As soon as possible!

Touch me up : abada[dot]zulma[at]gmail[dot]com
Thanks for your response both. I've spoken with KK regarding this and he's going to take a look in a few days as he's currently busy. So hopeful on getting a resolution.

I'll also look into what you've both suggested and see if I can work it all out once back at my office. Can't do much with a iPhone lol

Thanks again
tim wrote: I know my idea about using PayPal's JavaScript buttons is pretty far off on a tangent. It's just an idea.

As far as the code you posted above, trying to change the pp_payer_business_name variable is a dead end because that variable is returned after payment is made and PayPal returns payment verification to your page.

Scanning the code in the cart add-on, I'm not sure there's any way to change that seller email without messing around in the original code. The way it works, there's no way to affect it from the outside.


I think that'll benefit me more. Because I don't really want a cart as such. The buyer can only really buy one product at a time. Bit like eBay really.

I've looked into the scrip. Seams to be very simple to implement. I'll take a closer look once I'm back at my computer for sure.
30 posts Page 1 of 3