[solved]Order module FEU address retrieval&[need advice]Optional notes for order

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
markovica
Forum Members
Forum Members
Posts: 23
Joined: Mon Sep 13, 2010 11:17 am

[solved]Order module FEU address retrieval&[need advice]Optional notes for order

Post by markovica »

PROBLEM 1 - FEU adress retriaval
I don't even know exactly what to ask... I can't figure how address retrieval from FEU method works...

What I did:
- FEU set up, group and all extra fields...
- field mapping setup

I get all data from FEU in smarty vars on the template, but I am still presented with the blank form...

I don't know if it is the expected behavior, but I was expecting the billing form to be generated with data from FEU, so on submit I can add a function to optionally update FEU info and proceed with billing..

I found a way to solve the problem of form element values (JS on load, fill the form from smarty vars), but I would prefer to have the form elements rendered with the values from FEU...

PROBLEM 2 - additional data for each product in cart
I need additional data to be stored with the order for each purchased item (to be precise, course, and the additional data is the scheduled date)..
* Products - courses are defined here, no options, additional fields
* CGCalendar - admin templates modified (some default fields are hidden and updated via JavaScript on change) to provide an easy way of scheduling courses (items are stored with the name of the course)
* Orders - (supposed to) process the order, add selected dates as option or note for items in cart...

How would I in theory accomplish this?
Theoretical problems I am facing with this aproach (I didn't try to solve it yet):
- I have to limit the cart to accept only unique items (visitors are not supposed to schedule the same course twice, but can order all courses if they have enough money)
- I have to pass few arguments to the cart (later to order module) from the date selector view of cgcal (i've put the date selector in a fancybox popup with the "add to cart" button)

I tried to accomplish the desired functionality with Availability, but was way too much for me... Maybe i got it wrong, but i think that it would need too much hacking to get it work like i need it to:
- courses would be defined as resources and would have their max capacity
- user would book a course if max capacity is not reached...

From what i've understood, with availability module, I would sell the whole course, not available free lots for each course, so I opted for Product/cart/Order modules...

Please give me your opinion on these dilemmas I'm having
Last edited by markovica on Sun Oct 03, 2010 3:41 pm, edited 1 time in total.
markovica
Forum Members
Forum Members
Posts: 23
Joined: Mon Sep 13, 2010 11:17 am

Re: [help]Order module FEU address retrieval & [need advice]Optional notes for order

Post by markovica »

My mistake... smarty vars I get are not from orders module, they are from the login form.
markovica
Forum Members
Forum Members
Posts: 23
Joined: Mon Sep 13, 2010 11:17 am

Re: [help]Order module FEU address retrieval & [need advice]Optional notes for order

Post by markovica »

Please help me with the Order module.

CMS: 1.8.2 "Toliara"

Modules (what I thought is relevant):
Cart 1.7.2
CGCalendar 1.5.5
CGEcommerceBase 1.2.2
CGExtensions 1.19.6
CGPaymentGatewayBase 1.0.9
CGSimpleSmarty 1.4.5
CMSMailer 2.0
CustomContent 1.7.3
FrontEndUsers 1.12.2
JQueryTools 1.0.6
Orders 1.10.2
Products 2.8.5
SelfRegistration 1.6.5



when "Allow anonymous users to checkout:" is set to yes, the form displays
when is set to no, i get a blank template, no {content} (with following get_print_vars output when I add the tag)

Code: Select all

SCRIPT_NAME = /index.php
app_name = CMS
sitename = Down to Earth Training and Assessing
lang = 
encoding = utf-8
gCms = Object
cgsimple = Object
ccuser = Object
feu_smarty = Object
content_obj = Object
content_id = 19
page = 19
page_id = 19
page_name = view-cart
page_alias = view-cart
position = 00008.00001
friendly_position = 8.1
gcb_params = Array (1)
search_actionid = cntnt01
hogan = onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;"
searchtext = Enter Search...
startform = <form id="me69c0moduleform_2" method="post" action="http://www.down2earth.com.au/shop/view-cart" class="cms_form">
<div class="hidden">
<input type="hidden" name="mact" value="FrontEndUsers,me69c0,do_login,1" />
<input type="hidden" name="me69c0returnid" value="19" />
<input type="hidden" name="page" value="19" />
<input type="hidden" name="me69c0nocaptcha" value="1" />
<input type="hidden" name="me69c0returnid" value="19" />
<input type="hidden" name="me69c0feu_input_username" value="aleksandar.markovic@skgo.org" />
<input type="hidden" name="me69c0feu_input_password" value="tristan" />
<input type="hidden" name="me69c0submit" value="Sign in" />
<input type="hidden" name="me69c0error" value="This user is already logged in" />
</div>
label = <label for="cntnt01searchinput">Search</label>
searchprompt = Search
submittext = Submit
endform = </form>
menuparams = Array (4)
count = 2
nodelist = Array (2)
node = Object
mod = Object
returnid = 19
actionid = ma5380
actionparams = Array (2)
Products = Object
items = Array (35)
totalcount = 35
itemcount = 35
pagetext = Page
oftext = Of
pagecount = 1
curpage = 1
firstlink = <<
prevlink = <
lastlink = >>
nextlink = >
currency_symbol = $
weight_units = 
entry = Object
feuactionid = me69c0
feuactionparams = Array (7)
FrontEndUsers = Object
error = This user is already logged in
id_username = me69c0feu_input_username
prompt_username = Email Address
input_username = <input type="text" class="cms_textfield" name="me69c0feu_input_username" id="me69c0feu_input_username" value="aleksandar.markovic@skgo.org" size="40" maxlength="40" />
input_label = me69c0
id_password = me69c0feu_input_password
prompt_password = Password
input_password = <input type="password" class="cms_password" id="me69c0feu_input_password" name="me69c0feu_input_password" value="tristan" size="20" maxlength="20" />
prompt_rememberme = Remember me on this computer
id_rememberme = me69c0feu_rememberme
input_submit = <input class="cms_submit" name="me69c0feu_btn_login" id="me69c0feu_btn_login" value="Sign in" type="submit" />
link_forgot = <a href="http://www.down2earth.com.au/index.php?mact=FrontEndUsers,me69c0,default,1&me69c0nocaptcha=1&me69c0returnid=19&me69c0feu_input_username=aleksandar.markovic%40skgo.org&me69c0feu_input_password=tristan&me69c0submit=Sign%20in&me69c0error=This%20user%20is%20already%20logged%20in&me69c0returnto=19&me69c0form=forgotpw&me69c0returnid=19&page=19">Forgot Your Password?</a>
url_forgot = http://www.down2earth.com.au/index.php?mact=FrontEndUsers,cntnt01,default,0&cntnt01nocaptcha=1&cntnt01returnid=19&cntnt01feu_input_username=aleksandar.markovic%40skgo.org&cntnt01feu_input_password=tristan&cntnt01submit=Sign%20in&cntnt01error=This%20user%20is%20already%20logged%20in&cntnt01returnto=19&cntnt01form=forgotpw&cntnt01returnid=19
link_lostun = <a href="http://www.down2earth.com.au/index.php?mact=FrontEndUsers,me69c0,default,1&me69c0nocaptcha=1&me69c0returnid=19&me69c0feu_input_username=aleksandar.markovic%40skgo.org&me69c0feu_input_password=tristan&me69c0submit=Sign%20in&me69c0error=This%20user%20is%20already%20logged%20in&me69c0returnto=19&me69c0form=lostusername&me69c0returnid=19&page=19">Forgot Your Login Details?</a>
url_lostun = http://www.down2earth.com.au/index.php?mact=FrontEndUsers,cntnt01,default,0&cntnt01nocaptcha=1&cntnt01returnid=19&cntnt01feu_input_username=aleksandar.markovic%40skgo.org&cntnt01feu_input_password=tristan&cntnt01submit=Sign%20in&cntnt01error=This%20user%20is%20already%20logged%20in&cntnt01returnto=19&cntnt01form=lostusername&cntnt01returnid=19
Cart = Object
currencysymbol = $
weightunits = kg
pricetext = Price
cart_itemcount = 0
cart_totalprice = 0
carttotal = 0
numitemstext = Number of items
target = target='_blank'
href = http://www.down2earth.com.au/index.php?mact=Printing,cntnt01,output,0&cntnt01url=aHR0cDovL3d3dy5kb3duMmVhcnRoLmNvbS5hdS9zaG9wL3ZpZXctY2FydD9zaG93dGVtcGxhdGU9ZmFsc2U%3D&cntnt01pageid=19&cntnt01returnid=19
linktext = Print this page
imgsrc = modules/Printing/printbutton.gif
imgclass = 
linkimage = <img src="modules/Printing/printbutton.gif" alt="Print this page"  title="Print this page" />
class = noprint
image = <img src="modules/Printing/printbutton.gif" title="Print this page" alt="Print this page"  />
Orders = Object
cg_errorclass = error
cg_errormsg = The user is not logged in <em>(or not a member of the required group)</em>
checking further... I seem to not get $uid var in default action (i might be wrong... tried adding if/elseif routines to output...

When I added Custom Content module, it collects user data correctly...

I don't know where to look nor how to find the error... I have some PHP experience, but far from being a guru (unable to find the cause).

I removed Order Module and installed it back, and the behaviour is the same... templates in order module are default (just corrected the *>)
pedes
Power Poster
Power Poster
Posts: 840
Joined: Tue Jan 27, 2009 11:47 am

Re: [help]Order module FEU address retrieval & [need advice]Optional notes for o

Post by pedes »

I do not really understand all of your topic, but i think what you try to say
that you get an empty {Orders} page ?
I think you need to change some code, look at this topic:
The other qustion about having more info in your cart, of it is that what you want to explain ?
I think you can add all the fields of that are in your product detail.
So if you create the fields in the products module then you can use them
in the Orders and the Cart modules

kind regards
Peter
markovica
Forum Members
Forum Members
Posts: 23
Joined: Mon Sep 13, 2010 11:17 am

Re: [help]Order module FEU address retrieval & [need advice]Optional notes for order

Post by markovica »

Actually, i've reinstalled everithing...
in the previous setup, i guess i managed to return always true on user check, but no data from feu to fill the form - that's why I got the blank form
after module reinstall and reading your guides, i found that

Code: Select all

if( !$feu ) return FALSE;
in class.orders_helper.php needed to be changed to

Code: Select all

if( !$feu = $module->GetModuleInstance('FrontEndUsers') ) return FALSE;
to get the correct boolean for user...

now to find out how to return an array of values from FEU to fill the form...


the template was fixed...
trailing slash - i couldn't find it in my case (maybe fixed it, i'm working on this one day and night... deadline approaching)
finaly, since bugs are being fixed more frequently in svn, i downloaded, installed, and the same issue...

i'll keep trying  ???

---- second issue ----

As for the advice i asked, the problem is I want to pass the variable from a dropdown box generated from CGCalendar through a template

Template from CGCalendar:

Code: Select all

<select name="date1" id="date1"> 
{foreach from=$events key=key item=event}
<option value="{$event.event_date_start|date_format:"%d.%m.%Y"} - {$event.event_date_end|date_format:"%d.%m.%Y"} - {$event.title}">{$event.event_date_start|date_format:"%d.%m.%Y"} - {$event.event_date_end|date_format:"%d.%m.%Y"}</option> 
{/foreach}
</select>
I'm calling it in the details template of Product module, just before the add to cart button. That portion of the detail template looks like this

Code: Select all

{* booking popup *}
<div style="display:none;">
<div id="booking-form">
   {* available date selector  - still need to add an UDT to check capacity*}
   <form style="padding: 20px;" action="{$smarty.get.page}">
      <p>Select date<br />
      {cms_module module="CGCalendar" display="upcominglist" unique_only=1 upcominglisttemplate="dateselector" filtercourse=$entry->product_name}</p>
</form>
   {* global_content name='booking-form' *}
   {* include the cart *}
   {cge_have_module m='CGEcommerceBase' assign='tmp'}  
   {if $tmp}
      <div>{cgecomm_form_addtocart addtocarttemplate="book-button" product=$entry->id}</div>
   {/if}
</div>
</div>
In the end, I will actually need to pass 2 selected dates from those dropdowns to the order module, and to the FormBuilder (some rebates and registration).

This way I'll get a simple event booking system (couldn't manage to figure if it is possible to do it with Availability)
Last edited by markovica on Sun Oct 03, 2010 3:24 pm, edited 1 time in total.
markovica
Forum Members
Forum Members
Posts: 23
Joined: Mon Sep 13, 2010 11:17 am

[need advice]Optional notes for order

Post by markovica »

My mistake again... I guess I'm tired...
The solution is definitely changing the line from the post above
Post Reply

Return to “Modules/Add-Ons”