If this is your first visit, check our documentation. To post, register or login.
Forums / Addon Shipping Modules / Using AI to make modules?

Using AI to make modules?

Started by flappingfish on 22 Jan 2023, 2:23 AM · Views: 7,014

Results 1 to 15 of 15
22 Jan 2023, 2:23 AM
#1
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
319
Plugin Contributions:
4

Using AI to make modules?

ok so this is a really frustrating thing to attempt to do, it will insist it cant do it but ask it for an example fileset for that module after describing the features you want and then ask it what "custom_module.php" should look like to achieve the desired functionality and it will happily churn out the file???
Now i am a novice at coding and my community plugin contribution was a module i had paid to have made along time ago so not my work but i explained that in the submission and it must have been checked over before approval as it took a few days. I shared it as the way i see it is the more modules for the zen cart commerce system the more users and motivation behind updating and creating new modules which in turn is better for us all right??

I myself needed 2 modules and have tried to create them with chatgpt and if its being truthful well...

we now have...

a "qr tickets" module for events with a standalone login page for a new user type called admittance. it will apparently email the customer a pdf of the qr code and if they want a physical ticket it will generate the printable ticket as a pdf.

"royal mail click and drop" shipping module for OBA account holders - if your in the uk and use royal mail and are manually typing orders in i know your attention just got peaked!

I asked it to give me an option to allow me to select a standard royal mail box size for individual categories and assume a large parcel if not specified along with the option to override the royal mail pricing with a weight based shipping table option for certain categories as the carrier option "dpd" for my drop shipped category along with the ability to select different free shipping thresholds for individual categories.

being the fact im not a coder and asked an ai chatbot to make these i am not 100% confident when it says they should work as intended, apparently zen 1.58 was released after its dataset too so it may be coded to 1.57 standards?

now another module i want to add to my site to improve my sales is "klarna" payment integration, thought maybe best to see if someone who is adapt at coding would like to study one of these modules before i waste another day or two arguing with it to resume its response from where it stopped in its "example" due to character limits, it has a habit of apologising and starting from the beggining of the file?

Currently i have my usual developer who has said he will check out the qr tickets module but he has pretty much said he is a very busy and in demand fellow at present so i don't want to ask too much of his time by firing him a second module to check at the same time.

I know a few would most likely be interested in the royal mail module i had it whip up yesterday.... that and i'm really curious if this method works :D

Anyone curious in the experiment enough that they fancy testing the module out in a test environment to see if it does indeed work as intended?? i mean here's the screenshot of the fileset, looks like a module to me :S

Attachment 20190
it even made the read me on command!! :shocking::D
Attachment 20191

Also if you need klarna or would like to test a klarna module whipped up by the same tool?

22 Jan 2023, 10:53 AM
#2
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,880
Plugin Contributions:
7

Re: Using AI to make modules?

Interesting idea.
If it were me, and I had the time, I would try and get it to write a module that does the same as an existing simple module, and see the code difference.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

22 Jan 2023, 2:28 PM
#3
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
319
Plugin Contributions:
4

Re: Using AI to make modules?

i ended up making use of the subdomain to setup a new install of 1.58 and installed the module, it seems every file has a syntax issue here and there but once ran back through the ai with the error logs it helps me work out where it went wrong and corrects itself, my assumption here being people typically make syntax errors during a big project and they get spotted by the error logs and it not working as expected. currently im timed out waiting for it to let me ask it how i resolve this one.... [22-Jan-2023 13:36:43 UTC] PHP Fatal error: Uncaught Error: Call to undefined function zen_get_shipping_weight() in /includes/modules/shipping/royalmail_clickanddrop.php:28
Stack trace:
#0 /includes/classes/shipping.php(201): royalmail_clickanddrop->quote('')
#1 /includes/modules/pages/checkout_shipping/header_php.php(184): shipping->quote()
#2 /index.php(35): require('/home/u55452107...')
#3 {main}
thrown in /includes/modules/shipping/royalmail_clickanddrop.php on line 28

[22-Jan-2023 13:36:43 UTC] Request URI: /index.php?main_page=checkout_shipping, IP address: 86.25.115.190
--> PHP Fatal error: Uncaught Error: Call to undefined function zen_get_shipping_weight() in /includes/modules/shipping/royalmail_clickanddrop.php:28
Stack trace:
#0 /includes/classes/shipping.php(201): royalmail_clickanddrop->quote('')
#1 /includes/modules/pages/checkout_shipping/header_php.php(184): shipping->quote()
#2 /index.php(35): require('/home/u55452107...')
#3 {main}
thrown in /includes/modules/shipping/royalmail_clickanddrop.php on line 28.

i think its missing a piece of the file from between the interruptions caused by character limits and it resuming the code with a line or two missing, i've got used to spotting it now so in a sense its kind of teaching me how to fix the work its done which is helpful for future use. the install.sql was the hardest part it kept adding characters in that caused syntax errors, it would reply with the "fix" which was the same identical code snippet that had failed. finally got it to generate an install.sql that worked so im going to patch the files in the module files with the appropriate fixes and keep working through the errors with the assistant lol. I was so happy when i seen this....

Attachment 20192

It has been recognised by royal mail as an app and is indeed connected! I haven't been able to find anything like this and if i can iron the install into a smoother process and resolve the bug that stopped me proceeding to checkout pages in the module then i've cracked it. i mean it will probably need some optimisation to work as intended as i cant see settings i asked it to give me control of in the admin panel just yet, hoping the code errors have just stopped the script showing the options in the admin panel, currently it just seems to have the option to enter the api key which it does at least handle correctly to result in a successful connection to royal mail OBA

22 Jan 2023, 7:35 PM
#4
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
319
Plugin Contributions:
4

Re: Using AI to make modules?

ok so i got past the error code and managed to get stone walled again by more issues. seems everytime i rectified a syntax error it was improving and then this happened.....

Attachment 20193

I feel its either messing around with me because its overwhelmed and id have to return during off peak times to get more sense from it? :D or it originally excluded loads of code by not continuing the response or ending looking like the file was finished?

so far we have been able to make it through checkout, but only once before the changes caused a http 500 on me, the error logs keep leading me back to this file and this time it appears to be the very final line, well more precisely the blank line after the end of the code?

its connected to the api, no communication issues so that's all good but it seems to insist its either syntax related or something to do with the weight figure that has not queried rm for the pricing. maybe if i include my file it is groaning about someone can tell me if there's anything obvious jumps out?

require('includes/overrides.php');

if (!is_numeric($weight) || $weight <= 0) {
    trigger_error('Invalid weight passed to zen_get_shipping_weight', E_USER_ERROR);
}

if (!in_array($weight_class, array('kg', 'lbs'))) {
    trigger_error('Invalid weight class passed to zen_get_shipping_weight', E_USER_ERROR);
}

<?php
class royalmail_clickanddrop {
  public $code, $title, $description, $enabled, $api_key;

  // class constructor
  function __construct() {
    global $order;

    $this->code = 'royalmail_clickanddrop';
    $this->title = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_TAX_CLASS;
    $this->enabled = ((MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_STATUS == 'True') ? true : false);
    $this->api_key = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_API_KEY;
  }

  // class methods
  function quote($method = '') {
    global $order, $shipping_weight, $shipping_num_boxes;

    $dest_country = $order->delivery['country']['iso_code_2'];
    $dest_zip = $order->delivery['postcode'];

    $weight = $shipping_weight;
    $weight_class = 'kg';
    $weight = zen_get_shipping_weight($weight, $weight_class);

var_dump($weight); // 

// API call to Royal Mail Click and Drop to retrieve shipping rates
$api_url = 'https://api.royalmail.com/shipping/v2/pricing/' . $dest_country . '/' . $weight;
$api_headers = array(
'Content-Type: application/json',
'Authorization: Bearer ' . $this->api_key
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $api_headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

if (curl_errno($ch)) {
    trigger_error('Error connecting to Royal Mail API: ' . curl_error($ch), E_USER_ERROR);
}

$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($http_code != 200) {
    trigger_error('Error connecting to Royal Mail API. HTTP code: ' . $http_code, E_USER_ERROR);
}

curl_close($ch);

$shipping_prices = json_decode($response);

$shipping = array();
if (is_array($shipping_prices)) {
    foreach ($shipping_prices as $shipping_price) {
        $shipping[] = array(
            'id' => $this->code . '_' . $shipping_price->code,
            'title' => $shipping_price->name . ' (' . $shipping_price->estimated_delivery . ')',
            'cost' => $shipping_price->price
        );
    }
}

$this->quotes = array('id' => $this->code,
                     'module' => $this->title,
                     'methods' => $shipping,
                     'tax' => zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']),
                     'icon' => $this->icon);

if ($this->tax_class > 0) {
  $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
}
26 Jan 2023, 2:09 AM
#5
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
319
Plugin Contributions:
4

Re: Using AI to make modules?

well after a few days at this it seems that the more popular it becomes the more confused it gets so if you use it in a busy period it is more likely to make mistakes. we had a module that showed in the dashboard at one point, sadly now we have the following and it has timed me out for an hour for possibly the last time i find entertaining :s

[26-Jan-2023 02:01:32 UTC] PHP Fatal error: Uncaught Error: Using $this when not in object context in /includes/modules/shipping/royalmail_clickanddrop.php:32
Stack trace:
#0 /adminfoldername/modules.php(184): include()
#1 /adminfoldername/index.php(11): require('/home/u55452107...')
#2 {main}
thrown in /includes/modules/shipping/royalmail_clickanddrop.php on line 32

[26-Jan-2023 02:01:32 UTC] Request URI: /adminfoldername/index.php?cmd=modules&set=shipping, IP address: 86.25.115.190
--> PHP Fatal error: Uncaught Error: Using $this when not in object context in /includes/modules/shipping/royalmail_clickanddrop.php:32
Stack trace:
#0 /adminfoldername/modules.php(184): include()
#1 /adminfoldername/index.php(11): require('/home/u55452107...')
#2 {main}
thrown in /includes/modules/shipping/royalmail_clickanddrop.php on line 32.

my code for this file if anyone does come across this out of curiosity is currently about the 14th revision and possibly a typo or curly bracket away from working or that far off its hopeless?

<?php
class royalmail_clickanddrop {
  public $code;
  public $title;
  public $description;
  public $enabled;
  public $api_key;
  public $category_exclude;
  public $free_shipping_over;
  public $free_shipping_over_category;
  public $box_size;


 public function check() {
    global $order;

  // class constructor
  function __construct() {
    global $order;

 
    $this->types = array('letter' => 'Letter',
                         'largeLetter' => 'Large Letter',
                         'smallParcel' => 'Small Parcel',
                         'mediumParcel' => 'Medium Parcel',
                         'parcel' => 'Parcel',
                         'documents' => 'Documents');
    
  } 
}
}
    $this->code = 'royalmail_clickanddrop';
    $this->title = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_SORT_ORDER;
    $this->icon = '';
    $this->tax_class = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_TAX_CLASS;
    $this->enabled = ((MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_STATUS == 'True') ? true : false);
    $this->api_key = defined('MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_API_KEY') ? MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_API_KEY : '';
    $this->category_exclude = explode(',',MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_CATEGORY_EXCLUDE);
    $this->free_shipping_over = MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_FREE_SHIPPING_OVER;
    $this->free_shipping_over_category = explode(',',MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_FREE_SHIPPING_OVER_CATEGORY);
    $this->box_size = explode(',',MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_BOX_SIZE);
$this->check(); 

     if (MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_STATUS == 'True') {
        if (($this->enabled == true) && ((int)MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_ZONE > 0)) {
            $check_flag = false;
            $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ROYALMAIL_CLICKANDDROP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
            while ($check = tep_db_fetch_array($check_query)) {
                if ($check['zone_id'] < 1) {
                    $check_flag = true;
                    break;
                } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
                    $check_flag = true;
                    break;
                }

  }

  // class methods
  function quote($method = '') {
    global $order, $shipping_weight, $shipping_num_boxes;
    $dest_country = $order->delivery['country']['iso_code_2'];
    $dest_zip = $order->delivery['postcode'];

    $weight = $shipping_weight;
    $weight_class = 'kg';
    $weight = zen_get_shipping_weight($weight, $weight_class);

    // Check if the current product category is excluded from shipping
    $product_categories = zen_get_categories_for_product($_SESSION['cart']->get_products()[0]['id']);
    foreach($product_categories as $category_id) {
        if(in_array($category_id,$this->category_exclude)) {
            return array();
        }
    }
$api_url = 'https://api.royalmail.com/shipping/v2/pricing/' . $dest_country . '/' . $weight;
$api_headers = array(
'Content-Type: application/json',
'Authorization: Bearer ' . $this->api_key
);

$box_size = $this->check_box_size($_SESSION['cart']->get_products()[0]['id']);
$api_url .= '/' . $box_size;

if($this->api_key == ''){
trigger_error('API Key is not set', E_USER_ERROR);
}

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $api_headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

if (curl_errno($ch)) {
trigger_error('Error connecting to the Royal Mail API: ' . curl_error($ch), E_USER_ERROR);
}
curl_close($ch);

$response_data = json_decode($response, true);

if ($response_data['status'] != 'success') {
trigger_error('Error in response from the Royal Mail API: ' . $response_data['message'], E_USER_ERROR);
}

$quote_data = array();
foreach($response_data['prices'] as $service => $price) {
$quote_data['royalmail_clickanddrop_' . $service] = array(
'id' => 'royalmail_clickanddrop_' . $service,
'title' => $service,
'cost' => $price,
'tax' => zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']),
'cod_fee' => 0,
'calc_tax' => 'per_item'
);
}

// Free shipping over certain order value or category
if ($this->free_shipping_over != '') {
$free_shipping = false;
if (is_numeric($this->free_shipping_over) && $this->free_shipping_over <= $order->info['subtotal']) {
$free_shipping = true;
} elseif (in_array($_SESSION['cart']->get_products()[0]['id'],$this->free_shipping_over_category)) {
$free_shipping = true;
}
if ($free_shipping) {
foreach($quote_data as $key => $value) {
$quote_data[$key]['cost'] = 0;
}
}
}
return $quote_data;
}

function check_box_size($product_id) {
global$db;
$box_size = $this->box_size;

// Check if a custom box size has been set for this product
$product_query = $db->Execute("SELECT products_box_size FROM " . TABLE_PRODUCTS . " WHERE products_id = " . (int)$product_id);
if ($product_query->RecordCount() > 0) {
$custom_box_size = $product_query->fields['products_box_size'];
if (!empty($custom_box_size)) {
$box_size = $custom_box_size;
}
}

return $box_size;
}
}
}

i think its safe to say if the qr tickets module doesnt work when installed and tested it will probably need a lot of magic too, we shall see on that one but i dont want to test install another module without getting this one working right and it seems like i'm just re editing this same file over and over again with new suggestions from the ai sadly on the royal mail module

26 Jan 2023, 4:42 PM
#6
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
319
Plugin Contributions:
4

Re: Using AI to make modules?

Attachment 20194 ok so language file was missing its config_ prefix, plenty errors now as it runs into the remainder of the code though but im getting closer!

[26-Jan-2023 16:15:04 UTC] Request URI: /ADMINFOLDERNAME/index.php?cmd=modules&set=shipping, IP address: 86.x.190
#1  include(/testing/includes/modules/shipping/config_royalmail_clickanddrop.php) called at [/testing/ADMINFILE/modules.php:184]
#2  require(/testing/ADMINFILE/modules.php) called at [/testing/ADMINFILE/index.php:11]
--> PHP Warning: Use of undefined constant TEXT_DESCRIPTION - assumed 'TEXT_DESCRIPTION' (this will throw an Error in a future version of PHP) in //testing/includes/modules/shipping/config_royalmail_clickanddrop.php on line 229.

[26-Jan-2023 16:15:04 UTC] Request URI: /ADMINFOLDERNAME/index.php?cmd=modules&set=shipping, IP address: 86.x.190
#1  include(/testing/includes/modules/shipping/config_royalmail_clickanddrop.php) called at [/testing/ADMINFILE/modules.php:184]
#2  require(testing/ADMINFILE/modules.php) called at [/testing/ADMINFILE/index.php:11]
--> PHP Warning: Use of undefined constant TEXT_API_KEY - assumed 'TEXT_API_KEY' (this will throw an Error in a future version of PHP) in /home/u554521074/domains/crazygamer.uk/public_html/testing/includes/modules/shipping/config_royalmail_clickanddrop.php on line 235.

[26-Jan-2023 16:15:04 UTC] Request URI: /ADMINFOLDERNAME/index.php?cmd=modules&set=shipping, IP address: 86.x.190
#1  include(/testing/includes/modules/shipping/config_royalmail_clickanddrop.php) called at [/testing/ADMINFOLDERNAME/modules.php:184]
#2  require(/testing/ADMINFOLDERNAME/modules.php) called at [/testing/ADMINFOLDERNAME/index.php:11]
--> PHP Warning: Use of undefined constant TEXT_TITLE - assumed 'TEXT_TITLE' (this will throw an Error in a future version of PHP) in /testing/includes/modules/shipping/config_royalmail_clickanddrop.php on line 244.

[26-Jan-2023 16:15:04 UTC] Request URI: /ADMINFOLDERNAME/index.php?cmd=modules&set=shipping, IP address: 86.x.190
#1  include(/testing/includes/modules/shipping/config_royalmail_clickanddrop.php) called at [/testing/ADMINFOLDERNAME/modules.php:184]
#2  require(/testing/ADMINFOLDERNAME/modules.php) called at [/testing/ADMINFOLDERNAME/index.php:11]
--> PHP Warning: Use of undefined constant TEXT_DESCRIPTION - assumed 'TEXT_DESCRIPTION' (this will throw an Error in a future version of PHP) in /testing/includes/modules/shipping/config_royalmail_clickanddrop.php on line 249.

[26-Jan-2023 16:15:04 UTC] Request URI: /ADMINFOLDERNAME/index.php?cmd=modules&set=shipping, IP address: 86.x.190
#1  include(/testing/includes/modules/shipping/config_royalmail_clickanddrop.php) called at [/testing/ADMINFOLDERNAME/modules.php:184]
#2  require(/testing/ADMINFOLDERNAME/modules.php) called at [/testing/ADMINFOLDERNAME/index.php:11]
--> PHP Warning: Use of undefined constant TEXT_TAX_CLASS - assumed 'TEXT_TAX_CLASS' (this will throw an Error in a future version of PHP) IN /testing/includes/modules/shipping/config_royalmail_clickanddrop.php on line 257.

[26-Jan-2023 16:15:04 UTC] Request URI: /ADMINFOLDERNAME/index.php?cmd=modules&set=shipping, IP address: 86.x.190
#1  include(/testing/includes/modules/shipping/config_royalmail_clickanddrop.php) called at [/testing/ADMINFOLDERNAME/modules.php:184]
#2  require(/testing/ADMINFOLDERNAME/modules.php) called at [/testing/ADMINFOLDERNAME/index.php:11]
--> PHP Warning: Use of undefined constant TEXT_STATUS - assumed 'TEXT_STATUS' (this will throw an Error in a future version of PHP) in /testing/includes/modules/shipping/config_royalmail_clickanddrop.php on line 261.

[26-Jan-2023 16:15:04 UTC] Request URI: /ADMINFOLDERNAME/index.php?cmd=modules&set=shipping, IP address: 86.x.190
#1  zen_draw_pull_down_menu() called at [/testing/includes/modules/shipping/config_royalmail_clickanddrop.php:262]
#2  include(/testing/includes/modules/shipping/config_royalmail_clickanddrop.php) called at [/testing/ADMINFOLDERNAME/modules.php:184]
#3  require(/testing/ADMINFOLDERNAME/modules.php) called at [/testing/ADMINFOLDERNAME/index.php:11]
--> PHP Warning: Invalid argument supplied for foreach() in /testing/ADMINFOLDERNAME/includes/functions/html_output.php on line 417.
16 Jun 2023, 2:07 AM
#7
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,022
Plugin Contributions:
2

Re: Using AI to make modules?

flappingfish:

we now have...

a "qr tickets" module for events with a standalone login page for a new user type called admittance. it will apparently email the customer a pdf of the qr code and if they want a physical ticket it will generate the printable ticket as a pdf.

I presume you mean the royal "we".

I only discovered this long-silent thread yesterday and my interest was piqued by the mention of AI and event ticketing.

I am just wondering how you went with AI, which AI you used, and whether you used jdoodle or other online IDE in conjunction with the AI.

Did you get around to comparing AI results with an already established zen cart plugin/module, as suggested by Torvista.

Cheers

16 Jun 2023, 2:51 AM
#8
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
319
Plugin Contributions:
4

Re: Using AI to make modules?

dw08gm:

I presume you mean the royal "we".

I only discovered this long-silent thread yesterday and my interest was piqued by the mention of AI and event ticketing.

I am just wondering how you went with AI, which AI you used, and whether you used jdoodle or other online IDE in conjunction with the AI.

Did you get around to comparing AI results with an already established zen cart plugin/module, as suggested by Torvista.

Cheers

i used chat-gpt, it got me close but not close enough I could get it working on my own, for £350 i had the job finished by a freelancer. it can generate a physical ticket if requested and you can set an "admittance" user type that can login and only access the customer>tickets tab. It takes on average 4 seconds to email the ticket to the customer. i can use a qr code scanner to read the qr code and admit the guest. It will need more features like a database clean up method of old qr codes though to make admin easier. email size is relatively small that it sends and it saves the physical ticket print file (with unique qr code ect inputted) to the server. simply have one side mass printed for the event and then print the unique front out :cool:

and i did compare the code as torvista suggested, the ai would intentionally give me errors so i had to resort to help in the end lol

16 Jun 2023, 7:52 AM
#9
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,022
Plugin Contributions:
2

Re: Using AI to make modules?

Any chance you could bundle the ticket generating code into a plugin, however imperfect, incomplete or specialised, so that others might build upon it?

16 Jun 2023, 10:29 AM
#10
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Using AI to make modules?

StackOverflow prohibits the use of ChatGPT because while its output looks correct, it is frequently wrong. Proceed with caution!

https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned?cb=1

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

16 Jun 2023, 11:21 AM
#12
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
319
Plugin Contributions:
4

Re: Using AI to make modules?

It's not a very simple process with this module in all honesty. It requires other modules to create product field entries ect. That would be something the developer would possibly be able to sort out but it would no doubt result in another charge on freelancer. I paid £350 to have it made functional after about 6 weeks worth of infuriating back and too with chatgpt. I can't really put a price to the time i spent but basically this module would have to be at a small cost, I intend to run a multi k capacity event in the near future so i'd be in a great position to iron out any bugs that get found. id add screenshots but its not letting me, url says invalid type and from computer says i have exceeded my limit??

28 Jun 2023, 1:25 PM
#13
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
319
Plugin Contributions:
4

Re: Using AI to make modules?

dw08gm:

Any chance you could bundle the ticket generating code into a plugin, however imperfect, incomplete or specialised, so that others might build upon it?

I've just paid a bit more for the additional features i feel it needs to be complete and well rounded, estimated time to completion of upgrades is 2-3 days and then the developer is happy to compile it and create an install.sql and installation instructions. It requires additional product fields creating so will require "numinix product fields" or similar installed to create additional required fields for the module to function. A further £125 plus fees at freelancer spent today to complete upgrades to the module and mention of a further small charge to compile the install.sql, instructions and compile the files to a zip file ect by the developer.

I don't expect the demand to be great for the module. i'm happy to accept what one would consider an average price for a pre-built module at £75 to anyone that wants/needs it at the self install price. It is fully functional and you will want to buy yourself a qr scanner... the cheapest one on ebay was perfect to do the job.

I may pay for a mobile app to be developed that will allow login and scanning from an android device in the near future. I believe that can be achieved without changes to the website code. Seems more convenient to use an app than a laptop with qr reader attached. maybe anyone interested can code an app in exchange as an option too. I was quoted roughly the same price for developing the add on app as i'm asking for the module :) only issue was the person providing the quote was 8! Boy genius or disaster was my thought when i realised i was talking to a kid lol

29 Jun 2023, 1:31 AM
#14
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,022
Plugin Contributions:
2

Re: Using AI to make modules?

Thanks for the update.

If you have never created a module in zen-cart, I recommend attempting to do so as it is an education in itself.

The sale of a module can be hampered by the particular template a module was originally designed for and what the potential customer may be running or has modified. As I tend to run my own fluid responsive template designs, I am reluctant to pay for modules that may not work properly using the basic templates or that require considerable rework to get them to work in my templates. But without obtaining a working copy of the code I cannot get to check how it performs. I am sure there are many others in this position.

There is considerable scope for adoption and sales of a module if it is done right. As everyone is more or less an expert in their own field of endeavour, I see potential widespread use of a ticketing module for those wishing to sell their expertise by the hour using a time and/or venue-based booking system. In Australia I heard that tickets for Taylor Swift concerts are selling via Ticketek (an Australian event ticketing company) for close to $900 each and that close to 4 million tickets are being sought. The numbers are astonishing.

But I am nowhere near developing this level of business.

29 Jun 2023, 2:25 AM
#15
flappingfish avatar

flappingfish

Zen Follower

Join Date:
Nov 2020
Posts:
319
Plugin Contributions:
4

Re: Using AI to make modules?

dw08gm:

Thanks for the update.

If you have never created a module in zen-cart, I recommend attempting to do so as it is an education in itself.

The sale of a module can be hampered by the particular template a module was originally designed for and what the potential customer may be running or has modified. As I tend to run my own fluid responsive template designs, I am reluctant to pay for modules that may not work properly using the basic templates or that require considerable rework to get them to work in my templates. But without obtaining a working copy of the code I cannot get to check how it performs. I am sure there are many others in this position.

There is considerable scope for adoption and sales of a module if it is done right. As everyone is more or less an expert in their own field of endeavour, I see potential widespread use of a ticketing module for those wishing to sell their expertise by the hour using a time and/or venue-based booking system. In Australia I heard that tickets for Taylor Swift concerts are selling via Ticketek (an Australian event ticketing company) for close to $900 each and that close to 4 million tickets are being sought. The numbers are astonishing.

But I am nowhere near developing this level of business.

i've tried to install modules with varying levels of success. I am not a developer but the one i hired undercharged me as the job took longer than she expected. Process of code is to generate a qr code at checkout stage when payment returns as complete and it is triggered by the order being set to processing at checkout completion, it will "hang" the checkout confirmation for about 2 seconds as the php code executes 1 of 2 options.

option 1. issues QR code to email,
option 2. "physical ticket surcharge" module is active and setup and customer selected box during checkout for a physical ticket, it issues the qr code as in option 1 and saves a pdf file to server for printing on a4 card with unique information populated in predetermined locations (template included for png) you can run multiple events at once as it uses the item id to load the correct graphic for different events (or ticket types ie standard, vip ect)

email size is small to save on resources that it sends to customer. pdf can be downloaded and then deleted from server at leisure for physical tickets.

admission to event will send a welcome email to guests, handy for including safety information for guests and a nice message welcoming them off course.

QR code generated is a multiple digit random ticket id that as advised before can scan guests in using basic QR scanner. In admin panel you can create a special admin type such as "admissions" and assign them to only access the "customer>tickets" page in admin for gdpr purposes if using stewards ect to admit guests without showing figures such as sales or customer data. Steward selects cursor in search box and scans qr code to search for the ticket and can select "admitted" to complete the process. new upgrades mean after event you can do easy maintenance to remove qr codes from an old event. If event date is postponed then you do not need to do anything. Data will only be cleaned up when you ask it to be cleaned up. Basically for £75 you would be getting something that works and works well. coded to work on zencart 1.58 clean install with the numinix product field add on for additional fields required. roughly 1/8th the investment i made gets you the code that was about 3 months worth of development to create. Even if it isn't perfect for your liking you take me as someone who would revel at making changes regardless of how well it had been made? ;)

I cant share screenshots for some reason but i do have a testing site. Once the upgrades are complete you could check out the modules functionality and i could create you a temporary admission user login to show you the admin side for admissions though :cool: