close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Class eCart Repeat Region

Thread began 7/08/2020 11:53 am by Daniel | Last modified 7/08/2020 2:45 pm by Ray Borduin | 16 views | 4 replies |

Daniel

Class eCart Repeat Region

Good Morning,
how are you?

1. How do I put an outside(the array is created outside the class) array inside a Class?
I create the array but it doesn't read or display it when I want to print it out through a method in a Class.

Because what I want to do is that the products have different pickup addresses and the delivery address is only one address so I'm using the
ecart repeat region to get that information and then create a array and then work out the one or more quotes depending on the amount of pickup
addresses for the ecart transaction. I'm using my own integrated Courier Service.

2. Where do I change the SESSION value for the eCart session the way I want it to be?

Thank you for your help.

Sign in to reply to this post

Ray BorduinWebAssist

You could declare the array as global in the class, or save it in the $GLOABALS object to be able to access it from within the class.

See: https://www.php.net/manual/en/reserved.variables.globals.php
and: https://www.php.net/manual/en/language.variables.scope.php

That should help you understand how variable scoping works in php so you can access data from different locations.

Sign in to reply to this post
Did this help? Tips are appreciated...

Daniel

Thank you very MUCH I appreciate your help.

Sign in to reply to this post

Daniel

What is wrong with my code?

<?php
$array = array();
while (!$ThankYouJesus->EOF()) {
$array[] = $ThankYouJesus->DisplayInfo("ID");
$ThankYouJesus->MoveNext();
}
$ThankYouJesus->MoveFirst();
$GLOBALS[$array];
print_r($array);

class DankieJesus {
function FreeInChrist() {
print_r($array);
}
}
$new = new DankieJesus();
$new->FreeInChrist();
?>

Sign in to reply to this post

Daniel

Hallelujah! Dont worry I got it:
<?php
$array = array();
while (!$ThankYouJesus->EOF()) {
$array[] = $ThankYouJesus->DisplayInfo("ID");
$ThankYouJesus->MoveNext();
}
$ThankYouJesus->MoveFirst();
$GLOBALS['hope'] = $array;
print_r($GLOBALS['hope']);

class DankieJesus {
function FreeInChrist() {
print_r($GLOBALS['hope']);
}
}
$new = new DankieJesus();
$new->FreeInChrist();
?>

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...