Show Posts


Topics - dhigz

Pages: [1] 2
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 / 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

3
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.

4
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.

5
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

6
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?




7

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

8
No matter what I do I cannot get the aroundClassNameMethodName_InitData function to work in my hooks file. Everything else (on, before, etc.) works fine.

What I am attempting to do is to replace the main function on storefront/pages/checkout/confirm.php with my own function and stop the native function from running. Using around will not allow my function to run but the native function still does. Using any other extension hook for InitData, my function will run but will still allow the native function to run. I can't use update data because the "damage is already done". In other words the order gets saved, exactly what I am trying to stop.

What I really want to do is is stop the existing "save order" function call in and replace it with a "save order" function of my own. I have specific requirements that do not work with the existing order core file.

I have tried replacing the entire confirm.php file with my own by placing my version in my extensions storefront/pages/checkout directory and adding the path in my extensions main.php file, but apparently this does not work as the controller will not be overridden. (interesting result though, when you remove the native controller file, it does use the extension controller file).

So I have two possible solutions and neither work. 1) use the extension hook "around" or 2) get the extension controller file to override the native file.

Any thought, ideas?

Don

9
I am using the hook onXxxxx_UpdateData in my extension core file to add a form field to an existing form. I don't want to just put it at the end but rather in a logical place within the form.

Is there a way to insert a form field after an existing form field? Any trick hidden functions I can use?

Open to suggestions.

Don

10
General Discussion / Have you ever output a $form array?
« on: August 02, 2016, 01:40:40 AM »
Have you ever output a form array? (print_r(array_values($form))) I did. It's huge as every element has the entire registry in the array.

If you want to try it, be careful as it will eat up your memory. Make a form with one form element just to see.

So AbanteCart gurus, can you tell me why every form element includes the entire registry as one of it's array values? There must be some valid reason to have all of this overhead every time you output a form.

Don

11
General Extensions / Multiple instances of timymce on admin pages
« on: July 26, 2016, 12:11:02 AM »
When placing more than one "texteditor" (aka tinymce instance) type form field on an admin side form, only the last tinymce instance works properly.

Any instances placed before the last one have these problems: 1) When switching to visual mode, the text area looses all formatting and buttons. Switching back shows correct HTML/Text View. 2) The field acts as an updateable field (ie. turns orange).

I took a look at the jquery code in the form/text_area.tpl file. First thing I noticed was 'tinymce.remove();' was at the very top which appears that the second instance would kill the first instance, but removing it had no affect one way of the other.

One thing I did find is that the value for 'activeEditor' was the last tinymce instance when you clicked on the first. This would suggest to me that activeEditor should be defined. I tried a few solutions, but could not get any to work properly.

Does anyone have a fix for this or a suggestion of how to proceed? The extension I am working on really needs multiple instances of tinymce on the page. This problem appears to be one of the downsides of switching from ckeditor.

Don


12
Development Help Needed / Problem with dispatch
« on: December 16, 2015, 01:25:20 AM »

Looking for developer help. I am working on a new extension and ran into a problem with the dispatch command.

In my extensions core file, I have the function: onControllerCommonSeoUrl_InitData(). I have a need for one page to execute a custom url different the the standard url output format generated by seo_url.php. This is the code I have:

Code: [Select]
public function onControllerCommonSeoUrl_InitData(){
                if (isset($this->baseObject->request->get['_route_'])) {
$parts = explode('/', $this->baseObject->request->get['_route_']);
if($parts[0] == 'my_page_name') {
  $this->request->get['m'] = $parts[1];
$this->request->get['y'] = $parts[2];
$rt = 'pages/XXXX/archive';
                                //name removed - don't want to say what the extension is yet

                                 unset($this->baseObject->request->get['_route_']);
                                 //this prevents the script in the base file (seo_url.php) from processing any other data
                                 
                                // The next two lines come from the end of seo_url.php       
//This line works
  $this->baseObject->router->resetController($rt);

                               // This is where the problem is...
  return $this->dispatch($rt,$this->request->get);


}else{

foreach ($parts as $part) {

                                 //continues ........
 

return $this->dispatch($rt,$this->request->get);
Dispatch does run but returns the correct layout for my page with blocks from the intended page and my index page.   

I tried inserting baseObject as you should in an extension core file:   
return $this->baseObject->dispatch($rt,$this->request->get);
This returns a blank page with the logged error:  error: AbanteCart core v.1.2.2 Call to protected method AController::dispatch()  from context 'ExtensionXXXXX'....

The page will load if I use the standard format non-seo url. It will also load if I use a RewriteRule in my .htaccess file (trying to avoid this). The values for dispatch route are correct ($rt = 'pages/XXXX/archive') and the values in the array are valid and correct. Values are correct in the block_layout table.

Any suggestions on what I need to do to get dispatch to properly run?

13
Development Help Needed / Second domain name without creating a store
« on: November 03, 2015, 01:07:01 PM »
Hi,

Anyone know how I could get a second domain name to point to a specific page within AbanteCart without creating a second store?

I have an extension I am working on that I would like the option to have a secondary domain name or a sub-domain be able to point to it. The extension resides within the cart and does have its own path by way of controller access (index.php?rt=xxx/xxx) and seo access (/xxx). I can get a sub-domain to point to /xxx but of course get errors and it does not work so well. Ideally the second domain pointer would be an alias to the main domain but keep its identity.

Creating a second store means creating a whole new set of template files, which I don't want to do as the extension relies on the existing store template files and data.

I thought about the possibility of using .htaccess redirect but have not tried it yet. I have also thought about partially creating a second store to get the identity but using the existing templates but I am not sure if this will cause additional problems.

Anyone have any thought on how I might accomplish this?

Thanks

14
Development Help Needed / Listing Grid %ID% Replacement
« on: July 29, 2015, 02:27:24 AM »
I am working on a new extension which has large presence on the admin side. As such I have a few pages using the listing grid functions. I am on my last section and I am having a problem with the $ID% value in the edit link being properly replaced. Instead of the the record set row value each link and grid row value is a sequential number starting at 1 and increasing to the amount of records. On top of that, if I change the order of the records, I get the same result with the numbering starting at one and progressing...the original number does not stay with the sorted value.

I have built several sets of pages using the listing grid and this is the first one I have seen this problem. All are structured the with the same code structure just replaced values. All data flows correctly from query to responses to controller except for this problem.

The correct record values are being added to the array in the results loop on response->rows[$i]['id'] = [my id value]  line on the response page. But somehow the values are not making it to the jgrid script. I have done all sorts of testing and can not find the problem.

Any suggestion of what may be causing this problem or where I should be looking?

Thanks in advance

15
Payment Modules / PayPal Express Checkout Process
« on: March 30, 2015, 03:40:10 PM »
I recently installed PayPal Express, set everything up and fully tested. Everything works except the checkout process seems to be out of order.

Normal process with credit cards and other payment methods: Cart -> Shipping -> Select Payment Option -> Confirm Order (and enter cc info) -> Success Page

The Paypal Express process is: Cart -> Select Payment Option -> Payment through Paypal -> Confirm Order Page -> Success

Shouldn't the Paypal Express process be the same as other processes?: Cart  -> Select Payment Option -> Confirm Order Page -> Paypal Payment - > Success

I have two concerns about the current process:

1) The current Paypal process relies on the user to click the confirm button on the confirm order page once returned from Paypal. I don't know about you, but a user (maybe an inexperienced user) might think they are done when they are done once payment is made to Paypal and not realize they need to click this final button.

2) The confirm order page gives the user the opportunity to make changes to their order, shipping options, and payment information. Shouldn't this be done before going to Paypal?

The current process actually hits PayPal twice, once after the payment option choice and once again after the confirm button is clicked. Granted, the actual checkout with Paypal takes place when the confirm button is clicked. If changes are made from the confirm order page they do reflect on the actual order record in both the cart and at Paypal. However, wouldn't it be more efficient to go to Paypal once the order is actually confirmed?

Just to see what would happen, I commented out the unction: onControllerPagesCheckoutPayment_ProcessData() in the core file and did follow the process of Payment -> Confirm -> Paypal. The only difference is that Paypal did not show the cart contents only the total. This is because the product data is not being sent to Paypal in the responses/confirm function. An easy fix.

The only thing I can figure is the designed process is intentional and there is good reason why the process is as it is. Please enlighten me or let me before I make changes to the extension.

Pages: [1] 2

Powered by SMFPacks Social Login Mod