Show Posts


Messages - Evergrowing

Pages: [1]
1
How-to questions / Re: Extend order (add a generated text)
« on: October 03, 2019, 10:19:30 AM »
The code is uniquely generated. Each code can only be used once, then it is invalidated.
Please, no hacks, I thought this through and this way (adding a field to table orders) is the only clean way of doing it. I just cannot find out how to write the code because of
Code: [Select]
$this->response->setOutput(AJson::encode($json))I see the line where the payment was successful, but I don't know how to call my script so that multiple codes get generated and putting this into the right variables

2
How-to questions / Re: Extend order (add a generated text)
« on: October 03, 2019, 07:12:14 AM »
I see a problem in the fact that if you put the product in the cart twice or choose a completely different product, this will not be handled properly. So there has to be a connection with the order and the products within. I added a column to orders called unlockCodes which will be filled according to what the user purchased. And that needs to be visible in the invoice. Everything else is just hacked  ;D
Example 1:
2x Game PQ, 1x Game HX --> generate 2x PQ code, 1x a HX code and put those 3 into unlockCodes
Example 2:
3x free product --> unlockCodes stays empty

Here is what I did
invoice.php (NOT THIS ONE (this was my mistake) admin/controller/responses/sale)
Code: [Select]
                $this->data['orders'][] = array(
                    'order_id'           => $order_id,
                      .....
                    'unlockCodes'      => $unlockCodes,

order.php (NOT THIS ONE admin/model/sale but storefront/model/account)
Code: [Select]
public function getOrder($order_id) {
   ....
 $order_data = array(
                'order_id'                => $order_row['order_id'],
                  ....
                'unlockCodes'         => $order_row['unlockCodes'],
            );

public function addOrder($data) {
$this->db->query("INSERT INTO `".$this->db->table("orders")."`
                            SET .... unlockCodes = '".$data['unlockCodes']."',

invoice.tpl
Code: [Select]
<?php echo $unlockCodes?>
invoice.php (storefront/controller/pages/account/)
Code: [Select]
$this->data['unlockCodes'] = $myUnlockString
I must say, the folder structure and the fact that variables are named so that the origin is not really clear confused me quite a bit.

Still need help with:
order.php doesn't seem to be quite the right place I noticed. Because the codes are then created before successful payment. Because default_authorizednet build the page with
Code: [Select]
$this->response->setOutput(AJson::encode($json)) , I dont know where to put my code.
Also, how do I call a php script twice? Include('file') can only be used once but my result is just a single code and not multiple ones.

3
How-to questions / Re: Extend order (add a generated text)
« on: September 28, 2019, 05:52:58 AM »
Well, calling my php script from there obviously works. But then, the user will only have the chance to see the code there. If he misses to write it down, he doesn't get another chance.
That's why I thought to either put it into the invoice (but the generation of the code shall only occur once) or into the confirmation email.

4
How-to questions / Re: Extend order (add a generated text)
« on: September 27, 2019, 03:30:04 PM »
Well actually the storing in DB is optional. As long as he receives it via mail, that is also OK.
I thought if I put it into a .tpl file, then he can refresh the page and generate more codes as he likes (not that bad because hardly anyone would figure that out).
I just closed my VM and am about to shut down my computer. Tmr I will look into success.tpl
Thanks for your help so far :)

5
Installation and Configuration / Re: Bug with shop logo
« on: September 27, 2019, 02:00:55 PM »
well I thought since this is the standard template, you could as well fix it so not everybody has to do that for themselves :)

6
How-to questions / Re: Extend order (add a generated text)
« on: September 27, 2019, 01:03:30 PM »
Maybe I can work better if I understand a few things more clearly:
1) when there's code like
public function update($order_id, $order_status_id, $comment = '', $notify = false) {
        $this->extensions->hk_update($this, $order_id, $order_status_id, $comment, $notify);
    }
    public function _update($order_id, $order_status_id, $comment = '', $notify = false){  }
(for some reason, I am not allowed to use the code-tag here  :o)
does this mean that now _update() is called? But why does the extension need to define this? I would rather think that only the second method is needed in the extension and the core stack will somehow call this new _update method
2) why do I need to alter the payment extension? Isn't my usecase something that has to be done when the invoice is created?
3) what is the difference between storefront/controller/responses and /storefront/controller/pages?
4) another example of where I don't understand php: the abstract class Model has a member $registry. If in eclipse I follow a method call of this member, it leads me to registry.php final class Registry. How can I or eclipse know the type of this member?? Uhm, is it that /** in php are not just comments??? If I delete the "comment" above the __construct method, eclipse doesn't know which type it is anymore.

If it would be easier, I think if I can just generate the unique code (only once per successful payment) and present it to the user somehow, I would also do this. In the end, I just need to give the code to the user somehow (mail would also be fine).

7
How-to questions / Re: Extend order (add a generated text)
« on: September 27, 2019, 09:15:08 AM »
your payment method extension code sounds like I programmed that  :-\
I just installed AbanteCart a few days ago and never learned php. I do know Java/C# but this framework is too big for me to properly understand yet, even after reading the create-extension-example.
Your comment doesn't really help me any further  :'(. What about extending the database? Is there no work beyond AbanteCart php to do?
Atm I only use Stripe, but if I also install the PayPal extension at a later point, do I need to extend that extension as well?

8
Installation and Configuration / Bug with shop logo
« on: September 26, 2019, 02:39:46 PM »
Hello

I think there is a bug with the shop logo. I have an image of 1500x360 (took me quite some time to figure out this size for the logo to fit somewhat).
But the image is only properly displayed on Firefox with the scaling-sizes 60%, 80% and 110%. With the rest, there is a white line over the image and the image extends the regular bounds. A transparent png did not seem to work, as it was producing a white background.

What is the proper way to upload a logo that can be transparent and independent of the size be displayed correctly? Because starting at 200%, there is a lot of white over and under the logo.

9
How-to questions / Extend order (add a generated text)
« on: September 26, 2019, 09:04:56 AM »
Hello

I want to call a php script (that generates a secret code) when the payment was accepted (--> order status Completed) so that this generated code is also saved to an order.
User Story: user purchases a digital game, downloads exe, but needs also a unique code that is generated when payment was successful. This code should be accessible by the user himself.

I assume I would need to add a new DB column to order_products or order_history, but then I haven't yet found the grips in terms of php.
I need to know where to invoke that script and what other parts I need to modify. Any help greatly appreciated ♥

10
Fresh Installation / Re: Can't get to the installation screen
« on: September 22, 2019, 07:56:55 AM »
root@kali: phpenmod mbstring
WARNING: Module mbstring ini file doesn't exist under /etc/php/7.0/mods-available

apt install php7.0-mbstring php7.0-zip php7.0-xml
see error above. I read here
stackoverflow dot com /questions/49570107/how-to-install-php7-0-mbstring-in-ubuntu-17-04
that this version is not supported anymore? Not sure if this is only for another OS though.
This all seems very weird to me.

11
Fresh Installation / Re: Can't get to the installation screen
« on: September 20, 2019, 02:14:00 PM »
Check if next Extensions blocks active or not on php version: xmlreader, xmlrpc, xmlwriter. They should be active.

I dont understand what you mean, can you clarify please?

12
Fresh Installation / Can't get to the installation screen
« on: September 18, 2019, 12:38:19 PM »
I tried to install AbanteCart on a rather old virtual Kali Linux. When I open my browser to install AC, I get the message "simpleXML functions are not available".
So I tried to install several php7.0 packets (mbstring, zip, xml). But I only get the error "couldn't find any package by glob/regex" for all 3 of them. Not even sure whether this is the right approach, just found it somewhere on StackOverflow.
What do I need to do to pass this error? Thank you

Pages: [1]

Powered by SMFPacks Social Login Mod