Show Posts


Messages - dhigz

Pages: [1] 2 3
1
Built-in Features / Resouce Library Modal Icon images
« on: September 13, 2020, 04:08:49 PM »
I am a  long term user of AbanteCart. It has always annoyed me that all icons how in the Resource Library Modal with the fa-code icon instead of the actual icon. Since my the issue has been corrected in the Media Manager and icons show as they truly are and my level of frustration reached a peak, I decided to fix the problem. Little did I know how easy it was.

A small edit to /admin/view/default/template/responses/common/resource_library.tpl is all it took.

On line 184 find:
Code: [Select]
<?php if ($rl['resource_code']) { ?>
<div class="thmb-prev thmb-icon">
<i class="fa fa-code fa-3"></i>
        </div>
<?php } else { ?>

Change it to:

Code: [Select]
<?php if ($rl['resource_code']) { ?>
<div class="thmb-prev thmb-icon">
<?php echo $rl['resource_code']; ?>
         </div>
<?php } else { ?>

Please consider making this change in future releases.


2
Extensions and Add-Ons / Re: Loading resource scripts in hook function
« on: September 07, 2020, 05:52:31 PM »
Thanks. That worked.

that was the last issues I needed to resolve.

3
Extensions and Add-Ons / Loading resource scripts in hook function
« on: September 03, 2020, 09:09:24 PM »
Hi,

I am attempting to add image functionality to and existing controller by loading the resource_scripts though dispatch and dispatchGetOutput like other controllers. I can add the html using addChild with no problem. The script portion is throwing an error: Call to protected method AController::dispatch() from context '...

Here is the code which is included in function onController...._UpdateData().
Code: [Select]
$resources_scripts = $that->dispatch(
            'responses/common/resource_library/get_resources_scripts',
            array(
                'object_name' => 'collections',
                'object_id'   => $id,
                'types'       => array('image'),
            )
        );
        $that->view->assign('resources_scripts', $resources_scripts->dispatchGetOutput());


Any suggestions of how I can get around this error or a different method to add the resource scripts?

Don

4
abolabo,

I seem to have run into another issue. I created the function afterModelCheckoutOrder_confirm() and I am able to get the order_id value with func_get_args(). But it seems not matter what I do I cannot call a query in the normal manor:  $that->model_catalog.... I even tried loading the model with this instead of that and using this-> for the query and they did not work either. I get the error: Call to a member function queryName() on null.

My assumption is that since I am not actually hooking on a controller, the normal rules do not apply. Any suggestions of how I can get a query to work in this case? 

5
Thanks abalabo,

I see the hook for this function as well as others. Not sure why it did not notice them before. I did find some hooks in the core/lib/order.pdf file specifically $this->extensions->hk_ProcessData($this, 'build_order_data', $order_info);.

If I want to add data to the build_order_data function $order_info array, what would be the proper function name to use?

Thanks

6
Extensions and Add-Ons / Best place to hook for a completed order?
« on: July 16, 2020, 08:22:27 PM »
Hi,

What is the best controller and method to hook to in order to capture a successfully completed order with payment made. Is ControllerPagesCheckoutSuccess the best controller? Or do you recommend another controller/method?

I do see the value for $this->session->data['processed_order_id'] is created after validation. Are there any other indicators of a successful order?

Thanks.

7
Thanks Basara,

I pretty much came up with the same solution of changing the
value = tinyMCE.activeEditor.getContent();
to
value = tinymce.get('text_editor_<?php echo $id ?>').getContent()

I also changed it in the else statement
} else {
            $('#'+newtab_id+ ' textarea')
                  .val(textarea.val())
                  .removeAttr('disabled');
            if(tinyMCE.activeEditor != null) {
               value = textarea.val();
               value = html2visual(value);
               tinyMCE.activeEditor.setContent( value );
            }

Thanks for making the change.

8
There is an inherent problem in AbanteCart with having more than one tinymce editor loaded on a single page. I have an extension where I need to have multiple instances of tinymce loaded. There may be other developers with the same issue.

In the admin/view/template/form/text_editor.tpl file which loads the instance tinymce for each texteditor form field type, the first command in the javascript portion is to remove all existing instances of tinymce on the page. This is correct in the creation of the custom tinymce editor used in AbanteCart. However, when the second instance is added it also removes the first, third removes the first and second, etc. While the editor looks and works right for the HTML/Text portion, the Visual portion will only work on the last instance added.

The solution is to remove the specific instance being loaded. Instead of tinymce.remove(), replace with tinymce.remove('textarea#text_editor_<?php echo $id ?>').

Now all instances of tinymce will work correctly. Please make this change in the next release.

9
Got it to work with suggestion #2. Thanks again for your help.

10
I am working on an extension that uses the new "Quick View" option. Everything is working great but I need to filter out a description field in quick view mode. The problem is I cannot get the viewport_mode value in func_get_args() in my hook function. The hook function does process  func_get_args() and I can get other value pairs, just not the viewport_mode/value pair.

I tried calling func_get_args() an InitData hook for the page, but get same result (or lack there of). Same result if called in an UpdateData hook.

The only way I could get it to work is to add $this->data['viewport_mode'] = $viewport_mode; to the base file.

Do you have any suggestions on what I can do so I do not have to edit the base file?

Thanks

11
Extensions and Add-Ons / Re: How to get and return data to Listing_Grid Hook
« on: September 09, 2016, 06:55:09 PM »


Wow, that worked great. Didn't even think about using CommonListingGrid. I'm going to use this for some other added features.


Thanks for your help Dimitri.

12
Extensions and Add-Ons / How to get and return data to Listing_Grid Hook
« on: September 08, 2016, 07:37:09 PM »
Hi,

What I am trying to is to add an additional drop down to the product search/filer form on the catalog/products page. No problem adding the field to the form through a hook. The problem is getting and returning data to the listing_grid controller with any form of hook (on, before, etc. & InitData, ProcessData, etc.)

With a standard controller, you can get data from the controller with $that->view->getData when the controller data is in the form of $this->data, $this->post, etc.. You can transfer data from the hook to the controller with $that->view->assign or $that->view->batchAssign($this->data). You can even resort to sessions.

Keeping in mind that we do not want to unnecessarily edit the base controller file, how do you transfer data back and forth with a listing_grid controller? Specifically how would I get filter data in and/or the response back? I could not find anything in the Developer guide that helps.

What have I tried?
1 - With the original goal I tried to add the new field value to the filter value with onControllerResponsesListingGridProduct_InitData and onControllerResponsesListingGridProduct_UpdateData. This is useless as anything you submit is overwritten in the function.

2 - Rewrote the entire ControllerResponsesListingGridProduct under onControllerResponsesListingGridProduct_UpdateData starting off by setting the original response to an empty array. The final command of the hook function is to set the output. I also created another query with parameters added for my filter data and call this query in the hook function.

Now what happens is both run, first the original then the hook. Tried using InitData, same result just the hook runs first then the base function. No matter which option, the output is still the result of the base controller function.

3 - Tried  aroundControllerResponsesListingGridProduct_InitData. Around does not work.

The only way I got it to work is commenting out  $this->load->library('json'); and $this->response->setOutput(AJson::encode($response)); in the base controller. Exactly what I want to avoid.


Any suggestions, ideas?




13

There is a small formatting issue on order confirm mail template (template/mail/order_confirm.tpl). It has existed on the first version I downloaded (1.1.9) and still exists today.

While it does not detract in any way to this wonderful shipping cart application, it is visible to every one of our customers. I fix it every time I upgrade, so I thought it worth mentioning and maybe it can get fixed.

If you look at the order confirmation email the customer gets, the top of the Model column does not align with the rest of the row. This is because it does not have the same style settings as the rest of the rows. Simple fix: add width: 15%; padding: 0.3em; to the style attribute to match the other columns.

Good to go.

Don

14
Dmitriy,

Do you need to identify the method when there is only one method in the class? I didn't try it as I mentioned I did find a work around.

Bottom line, the around_ method does not seem to work.

Thanks for your help.

Don

15
Actually while I would like a solution to one of my two problems, I did find a way around the issue. It's just talking more coding.

Pages: [1] 2 3

Powered by SMFPacks Social Login Mod