texts:
I have a onepage checkout and need a way to get every step while clicking through the checkout.
As the page is completly loaded I guess I can only use JavaScript.

checkout.accordion.currentSection;

That is so far my only achievment. But every time I click forward and back in my checkout there is no further response from this row. How can I achieve this with JavaScript?


texts: Scaling Magento 2 on multiple containers in production with generated code

texts:
I'm working on some auto-scaling Kubernetes infrastructure to run Magento 2, and I noticed that when I start new containers, I can't have the generated/ directory automatically compiled as part of the container image build—it seems like it needs a working Magento installation (which I'm not guaranteed to have when building the container) to compile.

So currently what I'm doing is, when a new container starts up (e.g. when autoscaling, or when updating code, and new containers are replacing old ones):

Check if Magento is installed.
If it is installed, run:

bin/magento module:enable --all
bin/magento setup:di:compile

This seems to work okay, and the new container works just like the old/existing ones—if I don't do the compilation step, I just get lots of fatal exceptions until I do the compilation.

But my question is this: is there some other/better way of handling the generated/ directory when you want to run Magento on multiple hosts/containers?

Should I share the generated/ directory via NFS like I do for var/? It seems that reading code out of that directory would be a lot slower with NFS... and maybe the extra minute or so it takes to start a new container is worth the tradeoff to have each container compile/optimize it's own DI code (vs. sharing the directory with other existing containers).


texts: just installed and can't access admin, need to set up 2 factor authentication but no email is sent

texts:
I've just in stalled magento 2.4.0 and trying to log into the admin area.
it returns a message telling me I have to set up two factor authentication and that I've been set an email.
You need to configure Two-Factor Authorization in order to proceed to your store's admin area
An E-mail was sent to you with further instructions
I've checked every email I have and there is no email.
this is on a live server


texts:
I am not familiar with JS at all and I was wondering how I can get this working in my Magento shop:

JSFiddle

I apologise in advance if this is a stupid question.


texts: Manufacturer logo problem on Product page

texts:
I have the code below to the view.phtml file and shows the manufacturer logo under the price.
The problem is that if I have no manufacturer it shows me the symbol that there is no image (only in Chrome)
How can I fix that?

<?php $_product = $this->getProduct();
$manufacturerName = $_product->getAttributeText('manufacturer');
$manufacturerId = $_product->getManufacturer();
echo '' ?>
<img src="/media/catalog/brand/<?php echo str_replace(' ', '_',$manufacturerId); ?>.jpg" alt="<?php echo $manufacturerName; ?>" title="<?php echo $this->__('For more of') ?>&nbsp;<?php echo $manufacturerName; ?>&nbsp;<?php echo $this->__('press here') ?>" />


texts:
I am planning to create a URL Based api which enable me to fetch resources using curl.
For example, If a client can request the resource by using the following url structure.

curl -some-variable http://mydomainname/magentoroot/api.php?func=addtwonum&parama=34&paramb=11

It should produce response within xml or json. Assume public key and private key encryption and decryption are done.

Is it a feasible method?? Or shall I go to REST or SOAP. I am much inclined to this method.


texts: Magento2 has three different modes but official documents don't talk about how does Magento 2.2.6 REST APIs' behaves in these three different modes?


texts: SUPEE-9767 Patch/CE 1.9.3.3 - One Page Checkout - Customer Registration issue

texts:
On a clean, vanilla install of Magento 1.9.2.4, patched with SUPEE-8788, SUPEE-9652 and SUPEE-9767, and with the new 'Enable Form Key Validation On Checkout' setting turned on, following a successful new customer registration checkout on the default One Page Checkout, no new customer is created and the customer is not logged in, although the order goes through fine.

Turning the 'Enable Form Key Validation On Checkout' setting off makes this work again. Has anybody else had this issue? It doesn't seem to matter which shipping/payment methods are used.

I've since tried this with a fresh, unaltered installation of Magento 1.9.3.3 and it seems to have the same issue. When registering a new customer through the one page checkout, no customer is created even through the order goes through fine, as long as the 'Enable Form Key Validation On Checkout' setting is switched on.


texts: Inovice: PDF draw table for purchased item

texts:
PDF Invoice Design is not proper. Text are not aligned properly.  I just want to make the text aligned properly or draw nice table for it.

 app/code/core/mage/sales/model/pdf/abstract.php

 app/code/core/mage/sales/model/pdf/invoice.php

i did look in both files.

in invoice.php file is function _drawHeader(Zend_Pdf_Page $page) that is for the headings.

while the printed items like: product name, price , qty etc are not properly aligned. i want to draw nice table for it.

i did changed            $this->y -= 10;  also did try to change the parameter of the array   $lines  but not working.

need help to aligned text and draw table in PDF.

find that attachment:


texts: How to isAnchor is yes using layout xml file.option is available yes in admin  but i have 200+ category so it is possible xml file.


texts:
I have a job interview in a few days and need some advice on what I should brush up on. I've been a web developer for 10 years but haven't worked with Magento in a few years, and even then it was only small things here and there.

What are some Magento specific topics that I should definitely know when going to a job interview? I realize this is somewhat subjective but I've only got a short amount of time to prepare so any advice here is much appreciated.


texts: Magento 2 Session Expire after return from payment gateway

texts:
We are facing the session expire issue, while, return from payment gateway.
We are integrated CCavenue Magento 2.3.4 Toolkit,
we are tried following ways

Cache => somebody told maybe problem of cache content checkout and cart pages, so we tried to disable full page cache, then tried.
Cookie Domain Mismatch => we are given the right hostname in cookie configuration.
Stickie Session => we follow this blog, they suggested to use SameSite=lax.

Still, the session expires, after return from the payment gateway. we debug our toolkit, the session is there, before redirected to the payment gateway. after return from payment gateway only. session expires.
Suggest me, what is the issue and how to fix this.


texts:
I have a couple of php files in magento lib that I need to rewrite in order to change the functionality. I searched about this but all the solutions I found did not work.
Does anyone know how to properly rewrite these files?


texts:
I  want to pass data from my 'phtml' template file to controller file please help me to do this.

this is my code for text box in phtml file
 <input type="text" class="input-text watch-keyup" id="vat_exempt_name[<?php echo $pid ?>]" name="vat_exempt_name[<?php echo $pid ?>]" value="<?php echo $vat_exempt_name; ?>">

I am calling it as

$vat_exempt_name = $this->getRequest()->getPost('vat_exempt_name');
in my controller file .Please help me if I am wrong anywhere


texts: changing layout to include a static block

texts:
Can anyone help me change this please?

<trade_customer_logged_in>
<reference name="product.info.tabs">
<action method="addTab" translate="title" module="catalog"
<alias>delivery_info</alias><title>Delivery Information</title>
<block>catalog/product_view_attributes</block>
<template>catalog/product/view/delivery-info.phtml</template></action>
</reference>
</trade_customer_logged_in>

So instead of it pulling in delivery-info.phtml I want it to pull in a static block I have created with the ID 'delivery-info'

Thanks!


texts:
So, I decided to make a database backup from the magento admin panel. But it´s taking too long and there´s no way to know if the backup is actually working or if it got stucked.
Is there a way to stop the process without losing data? I can´t access to any other admin panel utility or make any purchase on my store.


texts: How to disable link in telephone phone number in address book?

texts: Using magento 2.2, I want to remove link from phone number in address book. Not allow user click on number.


texts: Where can i find "Shop By" file Magento 2

texts: Where can I find the file that contains "Shop By" on the category pages?


texts: Magento bulk purchase for cloth cutpiece and roll

texts: I am developing a fabric site using magento where I need to implement bulk purchase functionality same as on http://www.fabricuk.com/fabrics/106-nylon-dress-net.html but I have no idea how to proceed. So please help me to find out the way. Thanks.


texts:
I want to encode an url in static block and decode it in result controller in catalogsearch module.

This is what I have:

How to encode from q=britania and pass it with href and later decode it in controller.


texts:
I have product prices in admin inserted including tax.

When adding product to cart, for vat exclusive countries, the cart and checkout correctly show the price minus tax.

But, on the product view and listing page, the product is shown including tax.

Is this a simple config issue i do not see?


texts: Orders do not show up in customers account until processing state

texts:
My customers place orders, and when they go to the My Orders section of their account, the orders do not show up until it has been invoiced and entered a processing state.

This is a problem because we like to review orders before capturing payment and they are contacting us thinking the orders did not go through


texts: How to create module to show all manufacturers in front end?

texts: I started creating a module in Magento 1.9. I have created an Index controller where I got a list of all manufacturers. How can I show this list in my theme layout, like category or product listing?


texts: Site is broken because counter gets an invalid number or reaches a certain number

texts:
After a while all websites are broken. When I restore db it works, but then it will be also broken after some time.

I found this code:

<?php $categoryHelper = $this->helper('Magento\Catalog\Helper\Category'); ?>
<?php foreach($categoryHelper->getStoreCategories() as $category): ?>
<?php $category_id= $category->getId(); ?>
<?php $_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$object_manager = $_objectManager->create('Magento\Catalog\Model\Category')->load($category->getEntityId());
$testse = $object_manager->getChildrenCategories(); ?>
<?php if($testse->count()>0) { ?>

In this case it appears that the code is using some counter and it is possible if this counter gets an invalid number or reaches a certain number, it can cause the application to break as seems to be the case and since there are no Apache web server errors generated, but a PHP code one - it means that the application's code is causing the issue.

I have ran another restore of only the database of the site and the issue had gone away, which means that the code is calling some variable from the database that after some change, is causing the application to break, which confirms that the issue is code-related.

I have now disabled the mega menu. Maybe then the issue will stop.


texts: How do you change the number of product columns?

texts:
I want to change the number of products that are shown. But I don't want to hard code this into the theme.

This:

…

should be transformed into this:

…

It's a simple change. The 4 needs to become a 6.

What's the best way to do this?


texts: How to Keep all Filters Visible after apply filter in Magento 2

texts:
I want to show All filters and there items visible after applying any Filter i update the code in
/var/www/html/wswlocal/app/design/frontend/Smartwave/porto/Magento_LayeredNavigation/templates/layer/view.phtml
<?php if ($filter->getItemsCount())):?> //replace this
<?php if (true)):?> // from this

now it show all filters but not show there items value how can i show all filters with there filter options.


texts: How can i remove update handle in magento 2

texts: I have removed blocks from xml file using <referenceBlock name="page.top" remove="true" /> but how can i remove <update handle="customer_account"/> from the layout file.


texts: liqpay magento2 configurations in payment account

texts:
I use this extension https://github.com/mcspronko/liqpay-magento2
who can give information about this settings:
Which URLs I have to use?


texts:
I have migrated from magento 1.9 to magento 2 everything migrated successfully. and i can see products in backend and it is assigned to a category. but when i open category on frontend i dont see any product and also elastic search is running properl.
did anyone face this issue or if i run composer install will it going to fix the issue.
Any help or suggestion will be great.


texts: Magento 2: Login customer from external site to Magento website

texts:
I want to login customer from external Laravel App to magento site.
I have multi store multi website setup (mean every store have separate website)

I try all available ways:

1) By importing Magento OM in Laravel app & try to login like its successfully authenticating the customer but on refreshing the Magento page customer not log in:

$store = $this->_objManager->create('Magento\Store\Model\Store')->load($storeId);
// Load customer
$customer = $this->_objManager->create('Magento\Customer\Model\Customer')->setStore($store);
if($customer->authenticate($email, $password)){
    $customerSession = $this->_objManager->create('Magento\Customer\Model\Session');
    $customerSession->loginById($customer->getId());
    $customerSession->regenerateId();

    if ($this->getCookieManager()->getCookie('mage-cache-sessid')) {
        $metadata = $this->getCookieMetadataFactory()->createCookieMetadata();
        $metadata->setPath('/');
        $this->getCookieManager()->deleteCookie('mage-cache-sessid', $metadata);
    }

    if($customerSession->isLoggedIn()) {
        echo $customer->getId(). "----Customer Logged in";
    }else{
        echo "customer is Not Logged in";
    }
}

In above case in Laravel controller printing: 145----Customer Logged in mean code wise I am getting customer session created properly in Laravel App. But on Magento site page reload customer not login.

2) I Also Try LoginPost Method:

I post ajax request from Laravel form

    xhttp.open("POST", "http://ie.domainName.com/customer/account/loginPost/", false);
xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xhttp.setRequestHeader("Content-length", params.length);
        xhttp.setRequestHeader("Connection", "close");
        xhttp.send(params);

to this controller same its authenticating the customer and & I get customers id in the execute function after authentication. But here as well when I try to reload Magento page in same browser its not login customer. What I am missing here ?


texts: How can I get collection result "column headers" or "column names" in Magento 1.9x?

texts:
How can I get collection result "column headers" or "column names" from query?

Suppose I have $data = Mage::getModel('catalog/product')->getCollection(); and I have some joins with other tables

I can get the data by running foreach on $data giving me the actual output data.

question: but how can I get the "header name" (or "column name") as I would see it when I run the same query in MySQL


texts: New Order Email Notification not working

texts: The website I am working on doesn't sends the orders notification email either to admin nor to the customers. But the admin and customers receive registration and reset password notification emails. I don't know why this is happening. I am facing this issue for the past 20 days.


texts: import product videos from old Magento 2 shop to newer version

texts:
One of our clients has had a redesign of his website (and got a total new one, products exported from the old one to the newer one.)

He had a lot of product videos on the old website, which need to be added to the newer one. Since we used a product export, rather then taking the old database, products have a different entity_id now.

I have updated the catalog_product_entity_media_gallery_value_to_entity table, so that the video value_id's are linked to the proper entity_id's.

When I check the database, all the videos lead to the correct sku's, so the update of the entity id was done correctly, however no videos are displayed.

Already tried a reindex, setup:upgrade, static-content etc

Any ideas what I am missing?


texts: Magento 2 : How to get attribute group id using attribute set id ?

texts:
I need to get all the attribute group id associated with the product.

Code:

$product_coll = $block->getProduct($product_id);
$pattr = $product_coll->getAttributeSetId();
$attrCodes = $block->getProductAttrData($pattr);
foreach($attrCodes as $attrCode)
{
    echo $attrCode->getDefaultFrontendLabel().'
';
    $code = $attrCode->getAttributeCode().'
';
    echo $product_coll->getData($code).'
';
    echo $block->getProductAttrValue($product_id, $code).'
';

}

I want to filter the attribute with it's group or group name "product  details".
Any help appreciated.


texts:
According to there documentation i needed to use phpinfo() to check for inconsistencies in my php.ini.

I have put it in the index.php because all other files are not accessable from the web. Or give error's like:

Fatal error: Uncaught Zend_Cache_Exception: cache_dir "/var/www/magento/var/page_cache" is not writable in /var/www/magento/vendor/magento/zendframework1/library/Zend/Cache.php:209

Is there a command like: magento cache:opcache:reset ?


texts: Remove top drop menu extension items from admin panel

texts:
Some of the extensions I've installed on my installation insist on having top drop down menu's in the admin panel that are duplicated in System/Configuration. It's gotten to a point where the items have now started a second row making it somewhat difficult to navigate.

How do you remove only these selected top menu items?


texts:
I want to add a comment to a magento order. When i try to do this with postman it works properly:

But when i do this with my php code, the request return an error:
//GET TOKEN
$url = '***/rest/V1/integration/admin/token';

$datos_usuario = array("username" => "****", "password" => "*****");

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $datos_usuario);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($curl);
curl_close($curl);

date_default_timezone_set('Europe/Madrid');
setlocale(LC_TIME, 'es_ES.UTF-8');
$DateTime = new DateTime();
$fecha = date("Y-m-d")." ".date("H:i:s");

$json = json_decode($result, true);

        $url = '****/rest/V1/orders/430/comments';

        $data = [
            "statusHistory" => [
                "comment" => "Pedido entregado al cliente",
                "created_at" => $fecha,
                "parent_id" => "",
                "is_customer_notified" => 0,
                "parent_id" => 430,
                "is_customer_notified" => 0,
                "is_visible_on_front" => 1,
                "status" => "complete"
            ]
        ];

        $data_string = json_encode($data);
        $authorization = "Authorization: Bearer ".$json;

        $curl = curl_init();
        curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization ));
        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($session, CURLOPT_POSTFIELDS, $data_string);
        $result2 = curl_exec($curl);

        $result = curl_exec($session);
        curl_close($session);
        $json2 = json_decode($result);

        var_dump($json2);
}

The error:
"message": "% fieldName \ is required." Enter it and try again. "
 "parameters": {
     "fieldName": "statusHistory"
 }


texts: Entire Site Timing Out both Front/Back End

texts: Whenever someone tries to enter in the company's admin page, the browser returns an error message, "This site can’t be reached". This error message also appears when trying to access the Front End website as well.


texts: Get all products of a specific category only - without products of its child categories

texts:
I want to get specific category product collection, not include it's child category product in it .

Below code which i have tried.

$category = Mage::getModel('catalog/category')->load(5);
 $getCollections = $category->getProductCollection()
         ->addAttributeToSelect(Mage::getSingleton('catalog/config')->getProductAttributes())
         ->addAttributeToFilter('visibility', 4)
         ->addAttributeToSelect('*');

can any one please help me ?


texts: Resolved: How to exclude specific attributes's values products in category product listing page?

texts:
I want to exclude product who has specific attributes in category product listing page.

I have created one attribute product_disble_listing. if product_disble_listing set yes to product that product not show in listing page. override below block in custom module.

Magento\Catalog\Block\Product\ListProduct

and I have added below code in custom module.

$this->_productCollection->addAttributeToFilter('product_disble_listing', array('neq' => 1));

product collection show correctly but product count, pagination, price filter, color attributes are showing wrong data.


texts: How to get Orders for specific product's attribute

texts: I want to apply filter as follow, I want to get All orders having product of specific attribute, my product has a custom attribute ii_id,my sql query may be like this "get all orders having product where ii_id==123",  here more than two tables (sales_flat_order,sales_flat_order_item,and tables for product)are involved, I am bit confused, how should I do this?


texts: Page auto redirects to cart after filling onepage shipping address and click on next

texts:
During one page checkout, after filling the shipping address and click upon next button page again redirects to cart page?

No errors are displaying and my log file also empty.

On app\code\core\Mage\Checkout\controllers\OnepageController.php file inside the method saveShippingAction() I can see $this->_getShippingMethodsHtml(). This causes the error.

To find the error on root folder index.php I changed the below line

#ini_set('display_errors', 1);

into

ini_set('display_errors', 1);

now on console I found below issue,

Fatal error:  Can't use method return value in write context in /magento/htdocs/app/design
/frontend/default/default/template/deliverydate/shipping_method/available.phtml on line 67

on available.phtml line no 67 I can find below:

<?php if(!empty($_rate->getMethodDescription())):?>

            <?php echo $_rate->getMethodDescription(); ?>

<?php endif;?>

Note: The same is working fine on my local server, I faced this issue on production server only.


texts:
I have upgraded a local install of magento 1.6 to 1.9
the magento install is on a windows server so I can't run mage script. I upgraded manually by copy and paste the magento 1.9.1 system files replacing the old one.

I didn't expect this to work, but it did! Now that I have and upgraded version of magento I have password error for both customers and admin users.
This is not the "usual" cookie or session issue. I have understand this happens due to the different ways password are generated in magento 1.6 and 1.9: the salt is no longer 2 character string but 32.
if I manually generate a new encrypted password staring from the same old non encrypted pw value and update this in the database I can correctly login.
I made a test with this code in a getpw.php file in the magento root:

<?php
require_once 'app/Mage.php';
Mage::app();
## For magento1.7 or Earlier var
//$_HASH_SALT_LENGTH = 2;
## For magento1.8 and magento1.9
$_HASH_SALT_LENGTH = 32;
#Generate admin password
$password = "my-old-password-value";
echo $adminPass = Mage::helper('core')->getHash($password, $_HASH_SALT_LENGTH);
?>

I run this script and then copy the new pw in the database. This work fine both for user and admin.
The issue is that I have to now the old non encrypted password and obviously  this is true only for mine account.
There is a way to update all the password to the new format? I assume magento upgrade script takes care of it in some way... How can I do the same via SQL or PHP?

UPDATE:
HAs been pointed out question 70459 as a possible duplicate of this one.
I think it is not a duplicate of mine because in that case the old passwords with 2 character salt work and the updated one no. In my case it is the opposite: if I manually change the pw it update correctly, but if I don't update the user get "wrong password" error.
Moreover I don't have any database related issue in VARCHAR length like in the case of the question  70459.
I need to understand why the passwords with 2 characters salt are no more recognized and how to automatically update all the admins and customers pws with a one click script.

UPDATE 2:
I have also read the reddit post suggested in in the previously mentioned similar question. It ends whit this simple statement:

  However, Magento should still correctly recognize old passwords.

So the issue I'm experiencing is a bug caused by the upgraded process. And not by a wrong configuration of a database field link in the case of the other question.
I'll really appreciate any advice on how to fix this issue.


texts:
I have Created custom payment method i have 3 field in my payment method

1 - Vendor list(drop-down)
in the drop down all vendor list show and there is also an option other if customer select other in vendor list i want show 2 more fields

Vendor name
Voucher code

if customer select vendor name from drop down list then just voucher code field will display

Note: initially both field will be hide now how i can achieve this

        <div class="control">
            <select name="payment[transaction_result]"
                    class="select"
                    data-bind="
                              options: getTransactionResults(),
                              optionsValue: 'value',
                              optionsText: 'transaction_result',
                              optionsCaption: $t('Select A Learning Vendor'),
                              value: transactionResult">
            </select>
          </div>
        </div>


texts: Send order information to a third party payment gateway

texts:
I have to make a new payment module which redirect to a third party payment gateway.

When the customer click the PAY button the POST parameters (order details) need to be sent to the gateway. (And then after the successful/unsuccsessful payment the customer needs to be redirected to a success/cancel page respectively.)

According to the instructions given by the gateway provider An easy way to implement this functionality is to insert fields of type hidden at the e-shop payment form. These fields would contain values about the merchant, amount, payment details etc. For example:

<form action="https://www.gateway.com/.../" method="post" ID="Form1">
<input type="hidden" id="AmountToPay" name="AmountToPay" value="amount"/>
<input type="hidden" id="AmountCurrency" name="AmountCurrency" value="currency"/>
<input type="hidden" id="Details1" name="Details1" value="details"/>
<input type="hidden" id="Details2" name="Details2" value="orderID"/>
<input type="hidden" id="PayToMerchant" name="PayToMerchant" value="merchantID"/>
<input type="hidden" id="MerchantName" name="MerchantName" value="merchant"/>
<input type="hidden" id="PaymentOKURL" name="PaymentOKURL" value="https://shop.com/e-shopOK.html"/>
<input type="hidden" id="PaymentFailURL" name="PaymentFailURL" value="https://eshop.com/e-shopCancel.html"/>
</form>

Since my knowledge in Magento is somewhat limited, I'm having trouble translating this into a working magento module.

While researching I found several posible solutions, but I'm not sure which one is the right one (and how to implement them):

1.

$client = new Varien_Http_Client('http://www.example.com/');
$client->setMethod(Varien_Http_Client::POST);
$client->setParameterPost('name', $name);
$client->setParameterPost('address', $address);
//more parameters
try{
    $response = $client->request();
    if ($response->isSuccessful()) {
        echo $response->getBody();
    }
} catch (Exception $e) {
}

2.

public function automatic(Varien_Event_Observer $observer) {
    $orderIds = $observer->getEvent()->getOrderIds();
    if (empty($orderIds) || !is_array($orderIds)) {
        return;
    }
    foreach ($orderIds as $eachOrderId) {
        $order = Mage::getModel('sales/order')->load($eachOrderId);
        //right our third party code
        client = new Zend_Http_Client();
        $client->setUri('http://eshop.com');
        $client->>setParameterPost(array(
        'api_key' => 'yourapi',
        'apikey' => 'xxxx',
        'message' => $message,
        'order_id' => $order_id,
        ...//more params
        ));
        $response = $client->request('POST');
        // Yet another way of preforming a POST request
        $client->setMethod(Zend_Http_Client::POST);
        if (!$response->isSuccessful()) {
            Mage::log($response);
        }
    }
    return $this;
}

etc etc.

I know it is not a very specific question, but any guidelines of how I could achieve this the right way?

EDIT

Following some tutorials I created some payment module which currently looks like this: Payment Gateway

Regards...


texts: Magento crash when I save or apply Catalog Price Rule

texts:
We have a very rare error for some days. The server goes down because the httpd in the server is increasing second by second GB... in minutes is in more than 20gb.
The service httpd has to be restarted and next other time the same.
We have ask to the server company, and says that there is a "query" that its all the time generating and its done infinitely:

  sendto(39, "\316\1\0\0\3SELECT catalog_product_entity_tier_price.value_id AS price_id, catalog_product_entity_tier_price.website_id, catalog_product_entity_tier_price.`all_group
  poll([{fd=39, events=POLLIN|POLLERR|POLLHUP}], 1, 1471228928) = 1 ([{fd=39, revents=POLLIN}])
  recvfrom(39, "\1\0\0\1\6y\0\0\2\3def\21DATABASE_NAME!catalog_product_entity_tier_price!catalog_product_entity_tier_price\10price_id\10value_id\f?\0\v\0\0\0\3\3B\0\0\0}\0\0\3\3def\21espa

We don't know what to do, we have test a lot of things and nothing.

  UPDATE: We have seen that this "crash" happens when I apply or save a
  "Catalog Price Rule"


texts: Installing Connect 2.0 extensions via SSH

texts: How do I install a Connect 2.0 extension to my local development box without using the /downloader UI? How can I script this in a deployment routine?


texts: magento 2 how to make custom attribute read only based on user

texts: I'm trying to build something like there are some custom attributes, these custom attributes should be editable by admin only for other users it should be read only format.


texts:
I have made an implemented a custom currency, and everything seems to work perfectly!

Except for the advanced search.  It uses the Base Currency (USD) and not the custom currency I created myself.  I would like for people to enter the custom currency, as they never see USD on the store and don't know the exchange rate.

Is there a setting somewhere, or does this require extensive coding?

I have an idea that I could divide whatever number they put in by the exchange rate, but that is the LEAST preferred solution.

Thanks!


texts:
I know in Magento 1 you can get the shopping cart details on any page with:

$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item) {
    $productId = $item->getProduct()->getId();
    $productPrice = $item->getProduct()->getPrice();
}

How do I do the same thing in Magento 2?


texts: Why 2 classes Magento\Framework\HTTP\Client\Curl and Magento\Framework\HTTP\Adapter\Curl for same purpose?

texts:
Magento Framework has 2 classes for Curl operations:

\Magento\Framework\HTTP\Adapter\Curl and

\Magento\Framework\HTTP\Client\Curl

What is specific use-case for each as both are capable of doing same job ?


texts: How to get recently viewed product collection in magento2?

texts:
I want to get the recently viewed product collection directly from model without using block function.

Thanks.


texts: Multistore redirect from https://old.dk to https://new.dk

texts:
I have 2 shops, with 90% the same products. Both shops are in the same Magento 1.9 Multi Store setup.
Now I want to "shut down" the old shop and redirect all visits from the old shop to the new shop.

As I understand all Multi store shops share the same .htaccess - so how do I write a rewrite/redirect that only redirects from https://old.dk to https://new.dk?

The URLs are almost all the same except the domain of course.

Can anybody help a novice?


texts: Italian translation.csv for tax not working

texts:
We have a Italian website on our Magento installation.  All the translations are working from our theme's locale/it_IT/translate.csv file with the exception of "Tax","IVA".  On the italian site Tax is being translated to Tasse  which is the default Magento translation that seems to be coming from app/locale/it_IT/.

I've reviewed this excellent Magento Stackexchange answer on this topic but can't seem to get it to work.

The translation is not working on our checkout page or to be more specific our /it/onestepcheckout/index/ page.

I thought that maybe our translation was conflicting with another module, I'm not sure how to check which module it could be conflicting with, so I guessed it was a checkout module and updated my csv with:

"Tax","IVA"
"Mage_Checkout::Tax","IVA"
"Magestore_Onestepcheckout::Tax","IVA"

I also tried to check to see where the 'tax' string was being called from to check that it was being called throught the __() method but couldn't find it in a template.  The closest I came was in the /onestepcheckout/onestepcheckout/review/totals.phtml template which has a method <?php echo $this->renderTotals('footer', $_colspan); ?>.  Here is the template file in it's entirety:

<?php
 * @category    design
 * @package     base_default
 * @copyright   Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php if ($this->getTotals()): ?>

&nbsp;	&nbsp;

    <?php $_colspan = $this->helper('tax')->displayCartBothPrices() ? 3 : 2; ?>
    <?php echo $this->renderTotals(null, $_colspan); ?>
    <?php echo $this->renderTotals('footer', $_colspan); ?>
    <?php if ($this->needDisplayBaseGrandtotal()):?>

        <td class="a-right" colspan="<?php echo $_colspan; ?>">
            <?php echo $this->helper('sales')->__('Your credit card will be charged for') ?>

            <?php echo $this->displayBaseGrandtotal() ?>

    <?php endif?>

&nbsp;	&nbsp;

<?php endif; ?>

I also checked the core_translate table and it was empty, I made sure the cache was cleared and disabled.  All the other translations from our theme's locale/it_IT/translate.csv file are working.

Any help or suggestions of where I should look would be really appreciated.  Could I add the translation from the core_translate table


texts: cross-sell products are not getting added while doing add to cart

texts:
In the product page cross-sell products are showing with checkboxes.
When I check some checkboxes and then click "add to cart" then the product along with the checked cross-sell products should added to the cart.
But only the product is getting added to the cart except the checked crosssell product.
I found that the code for adding product is written in
app/code/core/Mage/Checkout/cotrollers/CartController.php -->addAction()
Inside it some code is as follows..

$cart   = $this->_getCart();
$params = $this->getRequest()->getParams();
echo "<pre>";print_r($params);echo "</pre>";exit;
$cart->addProduct($product, $params);
$cart->save();

when I tried to print the $params then following parameters came..

Array
(
[uenc] => aHR0cDovL2Frc2hheWEuYWZpehyuSDepYS5jb20vcG9zdGJveGVzL3N0yu76ygEtbWljcm8tcG93ZXJsb2NrLTNtLTEwZnQtMC0zMy01MjM,
[product] => 19
[checkboxes] => Array
    (
        [0] => 534
        [1] => 222
    )

[qty] => 1
[related_product] =>
)

Is it a wrong format of $params ?
If no, then why only 19 is getting saved and 534 and 222 is not getting added ?

i.e. it is getting the crosssell product ids but not adding it.
Could anyone suggest what should be the right way to add $params ?
Thank you.


texts: Add different email-inline.css for different stores

texts:
I am using magento 1.9.3.2.
I am using english and arabic stores.

I want to align different styles for both different Stores.

How to add different email-inline.css for different stores.


texts: Am I rewriting Mage_Adminhtml_Block_Catalog_Product_Edit correctly?

texts:
Magento CE 1.9.2.2

I would like to rewrite Mage_Adminhtml_Block_Catalog_Product_Edit.

Specifically this file: app/code/Mage/Adminhtml/Block/Catalog/Product/Edit.php

In my custom module's etc/config.xml file I have this for the rewrite block (not actually MyCompany/MyModule):

<adminhtml>
  <rewrite>
    <catalog_product_edit>MyCompany_MyModule_Block_Adminhtml_Catalog_Product_Edit</catalog_product_edit>
  </rewrite>
</adminhtml>

But where this approach has worked before for overwriting other blocks, I'm now getting this PHP error:

PHP Fatal error:  Class 'MyCompany_MyModule_Block_Adminhtml_Catalog_Product_Edit' not found in /var/www/html/app/code/core/Mage/Core/Model/Layout.php on line 491

I think my config.xml rewrite entry might be at fault but I'm not certain.


texts: Magento 2 default checkout page too slow

texts:
3 with default checkout but it loading too slow
in that too
rest/default/V1/guest-carts/W4tUoafhV2AvU8CeJcnlzuALWRqSzfE1/shipping-information and payment-information

these api call taking time i disabled used payment methods and shipping
implemented cdn
Fallowed https://onilab.com/blog/magento-checkout-slow-fix-it-in-8-simple-steps/
https://bsscommerce.com/blog/magento-2-checkout-slow/
Select one of the payment methods then
Click on place order
payment information taking time
/rest/default/V1/carts/mine/payment-information
i checked this link
https://digitalstartup.co.uk/t/why-is-the-place-order-action-slow/1040/10
but no luck
can any one tell how we can solve


texts:
I am using multi-currency on magento site. Base currency of site is Danish Krone. I have placed an order with Euro and created invoice from admin for the order but when I am creating Credit memo for the order then getting error message "Maximum amount available to refund is DKK497,00".

I am getting this issue because .02 have added in subtotals as my you can see in attached screenshot. Can any one help me to resolve the issue.


texts: Magento 2 Exclude Free shipping method for specific products

texts: I have created one attribute for products, if that attribute value is yes than only it will be eligible for free shipping and other products will be excluded from free shipping. so when i add that product in the cart it wont count in free shipping.


texts: Magento 2 : Show order items custom option text value in order api (/V1/orders/{id})

texts:
I want to show order products custom option in default magento 2 api rest/all/V1/orders/order_id run

it looks like below as we know

I need text value of the custom option in default single magento api run.


texts: How to get orders items data from particular order?

texts:
I want to get details of custom options which selected whenever customer choose at order time.

Thanks


texts:
The string */?> (asterisk slash question-mark greater-than) is appearing in my texts after moving a magento installation over to my own ubuntu server (It previously was on an OVH shared server).

It looks like a php end tag, but I don't understand why.
I have not changed any file when transferring my installation, and when it was hosted on the previous server, I had none of these issues.
I thought it could be line-endings, and tried using dos2unix, but I'm not sure It did anything.

I remember changing a setting about line-endings in my IDE (phpstorm) recently, which is why I thought about it, and I don't see what else it could be.


texts: Magento 2: call helper function in ui component form

texts:
In my form.xml, I have used below code to show input field

<field name="price">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string">Shipping Price</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="dataType" xsi:type="string">text</item>
            <item name="formElement" xsi:type="string">input</item>
            <item name="elementTmpl" xsi:type="string">ui/form/element/price</item>
            <item name="currency_sign" xsi:type="string">$</item>
            <item name="source" xsi:type="string">shippingrates</item>
        </item>
    </argument>
</field>

As it was a price column I added below code to show currency symbol

<item name="elementTmpl" xsi:type="string">ui/form/element/price</item>
<item name="currency_sign" xsi:type="string">$</item>

Now the problem is that I want to pass the currency_sign dynamically using helper function, I was unable  to call helper  function here.
I tried below to call helper function, but none of them worked.

<item name="currency_sign" xsi:type="helper" helper="Namespace\ModuleName\Helper\Data::getCurrencySymbol" />

I tried this too

<item name="currency_sign" xsi:type="helper" >Namespace\ModuleName\Helper\Data::getCurrencySymbol</item>

Anyone has idea how to get this working?


texts: Magento 2 Recaptcha Uncaught TypeError: Cannot read property 'nodeName' of undefined

texts:
I recently updated from Magento 2.3.1 to 2.3.2. I now get the below error on every page. It worked fine on 2.3.1. I have checked to make sure the API website key and secret keys are correct. I have switched to the Luma theme and the error still shows. This is a core module and nobody has ever touched the code. I have done the normal clear cache, compile, upgrade, and removed the static and generated folders but the error still persists.

Uncaught TypeError: Cannot read property 'nodeName' of undefined
at acceptData (jquery.js:3762)
at internalData (jquery.js:3830)
at Function._data (jquery.js:4040)
at UiClass.initCaptcha (reCaptcha.js:161)
at reCaptcha.js:196
at dispatch (jquery.js:5226)
at elemData.handle (jquery.js:4878)
at Object.trigger (jquery.js:5130)
at Object.jQuery.event.trigger (jquery-migrate.js:633)
at jquery.js:5860


texts: What does "Persistent Shopping Cart" do?

texts:
We know that Magento saves a logged-in customer's shopping cart items in the database for a very long time (if not forever).

Then what's this "Persistent Shopping Cart" option for? What difference does it make? What's its advantage?


texts: Rewrite phtml file and js file in Magento 2

texts:
Currently, I have cc card HTML in

  MyModule/Testing/view/frontend/web/template/form.html

I want to rewrite this to phtml file with my module and js in web/js folder.
How can I achieve that?


texts: Magento2 - Get product Ids matching to shopping cart rule

texts:
I need to get the product Ids, matching to the cart rule, in my cron job.

I looked on some posts in stackoverflow, but in those answers, product is loaded for each rule.

I don't want to load each product again and again.

Somebody suggest a good way to do it.


texts: In magento 2 how to change a stock availability for 'out of stock' products in frontend

texts:
In Magento 2 how to change a stock availability for 'out of stock' products in frontend (category listing and product detail page).
I don't want to override a template file. I want to change a custom message instead of the 'Out of stock' stock availability message in frontend.

layout/catalog_product_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="product.info.form.content">
            <block class="Vendor\LowStockNotification\Block\Product" after="product.info.addtocart" template="Vendor_LowStockNotification::custom_file.phtml"></block>
        </referenceContainer>
    </body>
</page>

layout/catalog_categoy_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Template" name="custom.block" template="Vendor_LowStockNotification::custom_file.phtml" before="-" />
        </referenceContainer>
    </body>
</page>

custom_file.phtml

<?php
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$showStockStatus  = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('lowstocknotification/low_stock_notification/stock_status/show_stock_status');
$customMessage = $objectManager->get('Magento\Framework\App\Config\ScopeConfigInterface')->getValue('lowstocknotification/low_stock_notification/stock_status/custom_status');
?>
<!-- custom Stock -->
<input type="hidden" class="show-stock-status" name="showstatus" id="show_stock_status" value="<?php echo $showStockStatus ?>">
<input type="hidden" class="custom-status" name="showstatus" id="custom_status" value="<?php echo $customMessage ?>">
<!-- custom Stock -->

<script type="text/javascript">
    require([
    'jquery',
    'domReady!'
], function ($) {

    var showStatus = $('.show-stock-status').val();
    var customMessage = $('.custom-status').val();
    if(showStatus == 1 && !empty(customMessage)){
        $(".stock.unavailable").text(customMessage);
    }
});
</script>


texts: How to get Next Previous Post link in FishPig wordpress integration

texts:
I am using Fishpig Wordpress Integration, I would like to display Next and Previous Post link in Post page. In Wordpress we can use posts_nav_link() but its not working in magento.

Please guide me if anyone have some idea

I want next previous link like on this url http://www.maisondelgusto.com/en/stories/el-poaig-olive-oil-can-tell-us-so-much/


texts: Warning message while installing Magento 1.9.1.0

texts:
I am currently trying to install Magento 1.9.1.0 Downloader release. However when I get to the download part of the installation the following message appears at the top of the page:

  Warning: include_once(Mage.php): failed to open stream: No such file
  or directory in
  /home/drainage/public_html/magento/downloader/lib/Mage/Autoload/Simple.php
  on line 49

  Warning: include_once(): Failed opening 'Mage.php' for inclusion
  (include_path='.:/opt/php55/lib/php') in
  /home/drainage/public_html/magento/downloader/lib/Mage/Autoload/Simple.php
  on line 49

It proceeds with the download process but then gives me this message and will not allow me to continue. Can you please help?

"There was a problem during downloading of Magento packages. Please check the output frame for errors information and refresh the page to retry again."


texts: Magento2 - EAV cache issue saving qty in admin

texts:
We have this Magento 2.1 project running Production mode with "Update on save" mode for all indexes

Our customer manages catalog himself, and reported us some stock issues. Problem was changing quantity for a new product was not working. Process apparently ends fine, regarding the admin message ("Product was saved ok") but stock was not changed. We look in Magento log files, but we don't see any related report there

Our solution, finally, was to change indexes to "Update by schedule" and then force a reindex by console command. This solution, as far as I understand, means there is something wrong with that partial reindex fired when saving a product with "Update on save" index mode. What I am asking is for a confirmation about this... should not this problem be reported in Magento log files?

Assuming there is something wrong with our catalog data, I'd like to trace the problem, so I'd like to know which processes (the complete code trace) are fired after a product save in admin, with "Update on save" index mode. In this case, I suppose catalog_inventory ones are the most relevant

Apart from that, and checking the catalog, we've noticed some configurable products were sharing simple products, which is rare & we are not sure if could be the origin of the problem (although we assume system wouldn't let to do that if that's not allowed). Maybe this could have registered some wrong data in catalog database tables, and causing the problems with partial reindex? If that's the case... Where can I find in database which data is pending to be processed in the next full reindex process?

UPDATE

Finally, it was not an index related issue, but a cache issue https://github.com/magento/magento2/issues/7876

I am going to update question title, to clarify that for future user requests for this bug. About the bounty, I'll give the points for the most complete answer regarding the original question


texts: How to create a new tabs section on product detail page and add tabs as required?

texts:
I am trying to add custom tabs in a new section on product detail page and not the existing "detailed_info" group where generally tabs are being added.

You can see the screenshot as given below :

Let me know, if its possible and how ?

Any help will be appreciated. Thanks !


texts:
I have a requirement to create a cross sales report(Which combination of the product is most purchased by a customer with it order count), But i want to avoid those orders contains parents and child,Suppose if an order contains P1 ,P2 and P3 products(P2 is the parent of P1) then i want to show the combination like P2 and P3(excluded the child),likewise i have to show the combination of products (excluding parent and child and showing parents only with other products).

So for this i have created a table where i'm updating the order , product details and parent details.But facing an issue to identify the correct parent of product(same child is having multiple parents),So how can i tackle this situation and find the exact and correct parent for each products.

i'm using the table catalog_product_relation for identifying the parent ,child relation(but in this for same child have multiple parents).

Any suggestions/recommendations will be of great help.

Need SQl code for this.
Version Magento 1.9, Will be updating to magento 2 soon.


texts: Is it possible to modify listing page codes?

texts:
I have added column discount on catalog_product_flat_1 table . On frontend there is dropdown for Offers . It has 2 options like

15% Offer
25% Offer

On onchange I want to show list of products based on condition i.e discount = 15%

On which function I have to apply this condition?


texts: Is free extensions works on Magento 2 enterprise edition?

texts:
I have installed free extensions on my Magento 2 website which is a community edition. We want to do the same in Enterprise edition. Is the free extension works on enterprise edition.

Looking for your reply.


texts: Call multiple ajax simultaneously in Magento2 [Concurrent Request Blocking in magento2]

texts:
I am trying to import data with one ajax and trying to do live tracking of this imported data with another ajax to show progress bar(how many records have been uploaded).

checkPrgressVar = setInterval(checkPrgress, 1000);
importTaxes(importURL,cart_url,cart_token);

/* check progress of imported data */
function checkPrgress()
{
            $.ajax({
                url: $(document).find("input[name='progressURL']").val(),
                type: 'POST',
                dataType: 'json',
               // showLoader: true,
                data: "action=import_store",
                complete: function(response) { debugger
                    var response = response.responseJSON.output;

                },
                error: function (xhr, status, errorThrown) {
                    console.log('Error happens. Try again.');
                }
            });

}

/* import data  */
  function importTaxes(importURL,cart_url,cart_token)
  {
                $.ajax({
                    url: importURL,
                    type: 'POST',
                    dataType: 'json',
                    showLoader: true,
                    data: "cart_url="+cart_url+"&cart_token="+cart_token+"&action=import_tax",
                    complete: function(response) { debugger
                        var response = response.responseJSON.output;
                        if(response.result == 'processing')
                        {

                        }
                        else
                        {

                        }
                    },
                    error: function (xhr, status, errorThrown) {
                        console.log('Error happens. Try again.');
                    }
                });
 }

My checkProgress ajax returns response only after getting response from importTax ajax while this checkProgress ajax should be independent  of importProgress ajax.

However both ajax is calling different controllers, it seems magento is not allowing another controller to be called until it processed another one.

I don't know why it happens and how to resolve it ?

I have tried this link but not working.

https://stackoverflow.com/questions/42274778/is-it-possible-to-fire-multiple-ajax-requests-asynchronously-in-magento-2-backen

EDIT1: what I have figured out that if I call another external URL instead of magento2 controller in checkProgress ajax call. it started working. It means magento2 is not allowing another controller to be execute while another is running via import ajax.

EDIT2- Both ajax started to work as expected if I change session storage from "files" to "db" in env.php file. It seems a session blocking issue as explained in below link-

https://stackoverflow.com/questions/15686572/two-simultaneous-ajax-requests-wont-run-in-parallel

But use DB as session storage is not preferable. So If I use files as session storage still I don't know how to resolve it.

Have any one idea about it ?


texts: Magento 2 : Compiler gives Class Not Found error

texts:
I was trying to install Multi-Vendor Marketplace extension from Webkul. I followed these steps:

Copied the files to appropriate locations.
Ran php bin/magento setup:upgrade from root folder. At this point the website became unusable. ALso, the command ended with following statement 'Please re-run magento compile command' .
Next, I ran php bin/magento setup:di:compile which returned the following error

  [Magento\Framework\Exception\LocalizedException] Class
  Magento\Framework\App\Action\Action\Context does not exist

Any help would be highly appreciated in this regard.


texts: How to manage two shipping methods at once?

texts:
I have a scenario, where I want to enable two shipping methods at once, and make theme dependent on the type of product in the cart. If products with attribute A are in the cart, then shipping price with shipping method X, should be shown. If product with attribute B are in the cart, then price with shipping method Y should be shown.
And if both are in the cart then prices for both needs to be calculated and displayed, individual to products corresponding to each attribute/shipping method?
Any ideas how can this be managed in magento?


texts: Magento transferred to Local returning 500 attempting to install error

texts:
I'm attempting to duplicate a live site I'm working on to my local windows environment for testing. I'm using MAMP PRO to run the db.

I'm getting this 500 error:

  The website encountered an error while retrieving
  http://127.0.0.1:8888/index.php/install/. It may be down for
  maintenance or configured incorrectly.

What I've done so far:

Copied all my production files to local (using our git repo)
Dumped my magento production db and imported it into my mamp db
Edited app/etc/local.xml file and changed database info
In local mySQL edited the two core_config_data table entries
Deleted my cache
Set permissions for my entire local environment to be read & write (using windows folder permissions as chmod is not available on windows I believe)

After doing all that, I'm still getting the error.

What am I missing?


texts: Magento 2: How to set "Maximum Login Failures to Lockout Account" different Role wise?

texts:
We have this
https://docs.magento.com/user-guide/stores/security-admin.html

In the 'Maximum Login Failures to Lockout Account' field, enter the
number of times a user can try to log in to the Admin before the
account is locked. By default, six attempts are allowed. Leave the
field empty for unlimited login attempts.

How do I set this for different role wise?
I have multiple user roles and I want to set it different each role wise?
For example:
Role A : 10
Role B : 8


texts: How do I change ogg:image only for homepage in Magento?

texts: for almost 2 days looking for information, but I can not find how to change this og tag only for index page (frontpage) of Magento. Do you have ideas how to do it?


texts: Get collection of filtered products (layered navigation)

texts:
I am trying to get a collection of products according to filters applied in layered navigation.

I thought, that layer model's getProductCollection will do it for me, but as long as i see, it retrieves all products in the category without filters applied.

$productCollection = Mage::getModel('catalog/layer')
            ->getProductCollection();
        throw new \Exception(print_r($productCollection->load()->getSelectSql(1),1));

How can i get what i need?


texts: PHP Online refund in Firstdata payment gateway (Payeezy)

texts: I have implemented the Firstdata payment gateway for online payment. It is working fine. Now I want to implement the online refund functionality. If anyone provide me the sample script for Firstdata payment gateway in PHP then bit thanks in advance


texts: Delete all Orders, Sales & Customer Data in Magento

texts: How can i delete all Orders, Sales & Customer Data in Magento website?


texts: how to i add a javascript file in magento 2 module and how to call it in phtml?

texts: I try to add custom java-script file but giving error of different kind, please give me a proper example of adding JS in Magento 2 module and use it in phtml.


texts: getCollection return null on custom model collection Magento 2.3.4

texts:
I'm creating a custom module to make a model by using mage2gen, I named this model critic:

app/code/Vendor/Module/Model/Critic.php

namespace Vendor\Module\Model;

use Vendor\Module\Api\Data\CriticInterface;
use Vendor\Module\Api\Data\CriticInterfaceFactory;
use Magento\Framework\Api\DataObjectHelper;

/**
 * Class Critic
 *
 * @package Vendor\Module\Model
 */
class Critic extends \Magento\Framework\Model\AbstractModel
{

    protected $dataObjectHelper;

    protected $_eventPrefix = 'vendor_module_critic';
    protected $criticDataFactory;

    /**
     * @param \Magento\Framework\Model\Context $context
     * @param \Magento\Framework\Registry $registry
     * @param CriticInterfaceFactory $criticDataFactory
     * @param DataObjectHelper $dataObjectHelper
     * @param \Vendor\Module\Model\ResourceModel\Critic $resource
     * @param \Vendor\Module\Model\ResourceModel\Critic\Collection $resourceCollection
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\Model\Context $context,
        \Magento\Framework\Registry $registry,
        CriticInterfaceFactory $criticDataFactory,
        DataObjectHelper $dataObjectHelper,
        \Vendor\Module\Model\ResourceModel\Critic $resource,
        \Vendor\Module\Model\ResourceModel\Critic\Collection $resourceCollection,
        array $data = []
    ) {
        $this->criticDataFactory = $criticDataFactory;
        $this->dataObjectHelper = $dataObjectHelper;
        parent::__construct($context, $registry, $resource, $resourceCollection, $data);
    }

    /**
     * Retrieve critic model with critic data
     * @return CriticInterface
     */
    public function getDataModel()
    {
        $criticData = $this->getData();

        $criticDataObject = $this->criticDataFactory->create();
        $this->dataObjectHelper->populateWithArray(
            $criticDataObject,
            $criticData,
            CriticInterface::class
        );

        return $criticDataObject;
    }
}

app/code/Vendor/Module/Model/ResourceModel/Critic.php

namespace Vendor\Module\Model\ResourceModel;

    /**
     * Class Critic
     *
     * @package Vendor\Module\Model\ResourceModel
     */
    class Critic extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
    {

        /**
         * Define resource model
         *
         * @return void
         */
        protected function _construct()
        {
            $this->_init('vendor_module_critic', 'critic_id');
        }
    }

app/code/Vendor/Module/Model/ResourceModel/Critic/Collection.php

namespace Vendor\Module\Model\ResourceModel\Critic;

 /**
 * Class Collection
 *
 * @package Vendor\Module\Model\ResourceModel\Critic
 */
 class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
 {

    /**
     * @var string
     */
    protected $_idFieldName = 'critic_id';

    /**
     * Define resource model
     *
     * @return void
     */
    protected function _construct()
    {
        $this->_init(
            \Vendor\Module\Model\Critic::class,
            \Vendor\Module\Model\ResourceModel\Critic::class
        );
    }
}

when i tried to get the data collection like this:

public function __construct(
 \Vendor\Module\Model\CriticFactory $criticFactory
){
  $this->criticFactory = $criticFactory;
}

public function execute(){
   $this->criticFactory->create()->getCollection()->addFieldToFilter('critic_id','1');
}

I always got an error

Call to a member function addFieldToFilter() on null

then I tried to print the getCollection, but it returns empty

print_r($this->criticFactory->create()->getCollection());

then I tried to get the type, then it returns null

print_r(gettype($this->criticFactory->create()->getCollection()));


texts: Dynamic Tax Rate Calculation Based on Product Price

texts: i want to increase tax percent based on product price. if Product price is more than 5000 tax will be increased by 2%. Currently i have tax percent 5% for all products and it is applicable for all products.


texts: Magento 1.9.2 - Fails to send sales transaction emails

texts:
I've recently upgraded / patched a Magento store to version 1.9.2 (from 1.9.1 via Magento Connect). It runs on a Centos server using PHP 5.5.26. Everything seems to work fine except I'm not getting any sales transaction emails from the store.

I've verified that php mail can send email from the server via a small php script invoked via browser. And this test used the same email from and to addresses used by sales transaction emails.

I can see in the exception log that the cron task is running, but it is generating an exception that ends with:

  "exception 'Zend_Mail_Transport_Exception' with message 'Unable to send mail. ' in ...lib/Zend/Mail/Transport/Sendmail.php:137".

I've researched this error, but have not found anything leading to a solution.

I've verified the sales transaction emails are queued in the database (core_email_queue table) just waiting for the cron task to initiate sending.

I've even tried setting up a free Mandrill account and installed the MageMonkey extension. But, that is not sending emails either.

Still looking for a solution. Any suggestions on where to look would be appreciated.


texts: Magento 2: When Paypal Express will generate Payment Id?

texts:
I'm processing payment through Paypal Express Checkout.

Order is already processed in Backend & will store Transaction Id in database. But i need to process some Orders using API.

To do that i'm using https://github.com/paypal/PayPal-PHP-SDK.

It will generate Payment Id using  https://github.com/paypal/PayPal-PHP-SDK/blob/master/sample/payments/CreatePaymentUsingPayPal.php

https://stackoverflow.com/questions/39785327/magento-2-how-to-change-payment-action-method-on-the-fly-in-paypal-express

It keep asking me for Payment Id which start with PAY-XXXXXXXX. So does Magento store Payment Id?


texts:
I am trying to start cron job because I get an error when trying to install the extension.

according to this guide:
http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html

I opened Putty and connected to the server
Run commend  'crontab -e'
I put this line at the bottom

* * * * * /usr/bin/php /var/www/magento2/bin/magento cron:run | grep -v "Ran jobs by schedule" >> /var/www/magento2/var/log/magento.cron.log

and and I chose CTRL + O

now the program asks me how to save it, here is a screenshot, What should I do next?

I save cron path Ctr+X and confirm Y(yes)

Next step When I try run Cron Job via command line:
 'cd /bin'
and next line

./magento cron:run

I get error "Premission denied".

Below screenshot.


texts:
I am trying to set the manufacturer for import logic (REST API) and I have the manufacturer name. However the API is expecting an int for the manufacturer attribute.

Is there a way to programmatically set the manufacturer per product or first set/get the manufacturers and then use their IDs for the REST product set?

The error I get:

{"message":"Error occurred during \"custom_attributes\" processing. Attribute \"manufacturer\" has invalid value. Invalid type for value: \"A manufacturer name\". Expected Type: \"int\"."}


texts: Change from “1 Day USPS Priority Mail” to "USPS Priority Mail” - Magento 2

texts:
Modify on the shipping name from “1 Day USPS Priority Mail” and just have it say “USPS Priority Mail”
Ensure this is updated on all transactional areas (email/invoice details/etc)

how to do this update magento 2?


texts: Magento 2 - Data Migration Tool, unknown column store_id in customer_entity_varchar after data migration

texts:
I am trying to migrate a CE 1.9.4.5 site to CE 2.4.0 and have installed the data migration tool.
I managed to migrate both Settings and data successfully.
My orders, products, settings etc .. where successfully migrated
But when i try to perform reindex after successful migration, following error occurs
Catalog Search index process unknown error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 't.store_id' in 'field list', query was: SELECT `u`.* FROM ( (SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `customer_entity_varchar` AS `t` WHERE (entity_id = '3') AND (attribute_id IN ('111', '479', '113', '114', '118', '563', '533', '514', '927', '982')) AND (`store_id` IN ('2', 0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `customer_entity_int` AS `t` WHERE (entity_id = '3') AND (attribute_id IN ('119', '940', '941', '937', '117', '120')) AND (`store_id` IN ('2', 0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `customer_entity_text` AS `t` WHERE (entity_id = '3') AND (attribute_id IN ('112', '115', '116', '121', '122', '123', '926', '530')) AND (`store_id` IN ('2', 0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `catalog_category_entity_varchar` AS `t` WHERE (entity_id = '3') AND (attribute_id IN ('965')) AND (`store_id` IN ('2', 0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `customer_entity_datetime` AS `t` WHERE (entity_id = '3') AND (attribute_id IN ('565', '566')) AND (`store_id` IN ('2', 0)))UNION ALL(SELECT `t`.`value`, `t`.`attribute_id`, `t`.`store_id` FROM `customer_entity_decimal` AS `t` WHERE (entity_id = '3') AND (attribute_id IN ('942')) AND (`store_id` IN ('2', 0))) ) AS `u` ORDER BY `store_id` ASC

The same sql error is shown when i take the category menu in backend admin panel.
Note. I checked in my old magento 1.9.4.5 site, there also store_id column is not present in customer_entity_varchar table, but everything is working perfectly there.
Tried migrating data again in a freshly installed magento 2, but no luck.
Thanks in advance for your help.


texts: Magento banner slider not showing in localhost

texts:
I am using a ModulesGarden theme Crystal and I can't get the banner slider to show in CMS homepage.

I've tried this:

<block type="core/template" name="home_banner" template="page/baners.phtml"/>

<block type="core/template" name="baners" template="page/baners.phtml" home_banner="1"/>

but it doesn't show still. I corrected the Permissions for Magento 1.9.2.4.

Any suggestions? I contacted the developers but they haven't gotten back to me.


texts:
I use this code to create and add an item into the cart.

Here it is:

<?php
    error_reporting(E_ALL | E_STRICT);
    $mageFilename = 'app/Mage.php';
    require_once $mageFilename;
    $app = Mage::app('default');
    Mage::app();

Mage::getSingleton('core/session', array('name' => 'frontend'));

    ini_set('display_errors', 1);

$TITLE = $_POST["TITLE"];
$SKU = $_POST["SKU"];
$MANUFACTURER = $_POST["MANUFACTURER"];
$RNUMBER = substr(number_format(time() * rand(),0,'',''),0,4);
$SKUNUMBER = "$SKU-$RNUMBER";
$DESCRIPTION = $_POST["DESCRIPTION"];
$SHORTDESCRIPTION = $_POST["SHORTDESCRIPTION"];
$IMAGE = $_POST["IMAGE"];
$PRICE = $_POST["PRICE"];
$COUNT = $_POST["COUNT"];
$PRODUCTLINK = $_POST["PRODUCTLINK"];
$PRODUCTCOLOR = $_POST["PRODUCTCOLOR"];
$SizeOfProduct = $_POST["SizeOfProduct"];
if($SizeOfProduct == ""){
$SizeProduct = $_POST["SizeOfProductSD"];
}
else {
$SizeProduct = $_POST["SizeOfProduct"];
}

if($SizeProduct == ""){
$SizeProduct = "Само един е размера";
}

$ADDEDPRICE = $_POST["ADDEDPRICE"];

    $api = new Mage_Catalog_Model_Product_Api();

    $attribute_api = new Mage_Catalog_Model_Product_Attribute_Set_Api();
    $attribute_sets = $attribute_api->items();

    $productData = array();
    $productData['website_ids'] = array(1);
    $productData['categories'] = array(2,3);

    $productData['status'] = 1;

    $productData['name'] = utf8_encode($TITLE);
    $productData['description'] = $DESCRIPTION;
    $productData['short_description'] = "$SHORTDESCRIPTION
Посочен размер: $SizeProduct";
    $productData['ext_image'] = $IMAGE;
    $productData['product_link'] = $PRODUCTLINK;
    $productData['product_color'] = $PRODUCTCOLOR;
    $productData['product_size'] = $SizeProduct;
    $productData['product_add_price'] = $ADDEDPRICE;
    $productData['url_key'] = $SKU;

    $productData['price'] = $PRICE;
    $productData['weight'] = 0.50;
    $productData['tax_class_id'] =2;
    $productData['page_layout'] ='one_column';

    $new_product_id = $api->create('simple',$attribute_sets[0]['set_id'],$SKUNUMBER,$productData);

    $stockItem = Mage::getModel('cataloginventory/stock_item');
    $stockItem->loadByProduct( $new_product_id );

    $stockItem->setData('use_config_manage_stock', 1);
    $stockItem->setData('qty', 10);
    $stockItem->setData('min_qty', 3);
    $stockItem->setData('use_config_min_qty', 1);
    $stockItem->setData('min_sale_qty', 3);
    $stockItem->setData('use_config_max_sale_qty', 1);
    $stockItem->setData('max_sale_qty', 0);
    $stockItem->setData('use_config_max_sale_qty', 1);
    $stockItem->setData('is_qty_decimal', 0);
    $stockItem->setData('backorders', 0);
    $stockItem->setData('notify_stock_qty', 0);
    $stockItem->setData('is_in_stock', 1);
    $stockItem->setData('tax_class_id', 0);

    $stockItem->save();

$_product = Mage::getModel('catalog/product')->load($new_product_id);

$adress = (string)Mage::helper('checkout/cart')->getAddUrl($_product);

$hm1 = array('SignProduct.php/');
$ym1   = array('');
$adress = str_replace($hm1, $ym1, $adress);

header('Location: '.$adress.'');

?>

Take a look:

All items that i include in the cart by this script has selected quantity of 1.

How can i add an item into the cart with selected quantity of 3 for example ?

Thanks in advance!


texts: Adding a new step to a magento 2 checkout

texts:
I'm attempting to add a new checkout step in my own custom theme. I've followed the instructions here:

http://devdocs.magento.com/guides/v2.2/howdoi/checkout/checkout_new_step.html

My theme extends another theme (Infortis Ultimo) but for some reason the new checkout step doesn't appear in my checkout. However when I activate the Ultimo theme, it shows (even though the step definition [checkout_index_index.xml, step.html, step-view.js] is in my module)

I'm guessing it's something to do with load order. But no matter what I try (sequences etc..) I can't get my module to load above any other module.

How do I get my theme to load in the correct order and override the necessary xml in order to render my step?


texts:
How To Update the cost of a product by using the advanced pricing in import function.

In my csv file if I add the cost field it was showing an error.


texts: i have created module and overrdie core file now i add my module in vendor but when i add my module in vendor my override file not found


texts: How to make country_id/region_id/region to work in custom admin form?

texts:
I need country/region fields in custom form in admin panel. I have following fields:

        <field name="country_id">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="source" xsi:type="string">somesource</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
            </item>
        </argument>
    </field>
    <field name="region">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="source" xsi:type="string">somesource</item>
            </item>
        </argument>
    </field>
    <field name="region_id">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="dataType" xsi:type="string">text</item>
                <item name="formElement" xsi:type="string">select</item>
                <item name="source" xsi:type="string">somesource</item>
                <item name="customEntry" xsi:type="string">region</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
                <item name="filterBy" xsi:type="array">
                    <item name="target" xsi:type="string">${ $.provider }:${ $.parentScope }.country_id</item>
                    <item name="field" xsi:type="string">country_id</item>
                </item>
            </item>
        </argument>
    </field>

At the moment the problem is that select field are not populated by data. How to make the region updater to work in .xml admin forms?


texts: I am working on script and i have only Root Category Id of store. I want to get Store Details by Root Category Id.


texts:
How can I migrate my data from Magento 1.9 to Magento 2.1?

I have converted my site from Magento 1.9 to Magento 2.1


texts: product not show in category page in magento 2.0.2

texts: I am create a new theme but products are not showing in category page but while i will using Magento Blank theme products are showing please help me.


texts: How to Change Shipping Cost for Specific Products?

texts:
There are five product SKU that I would like to add a $10 shipping fee for each product added to the cart.

Example:

  if all 5 of the skus are added to the cart, there would be an additional $50 shipping fee added to the total price. Is there a way to do this in Magento 1.9.3.4? If there isn't a way to do this via editing the Shipping Methods, is there a work around by creating a Shopping Cart Price Rule?


texts:
I want to create my own custom template to choose from a CMS page in Magento 2.

I've already done the following:

Created bktext.xml

<?xml version="1.0"?>

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
    <update handle="2columns-left"/>
</layout>

And also layouts.xml

<?xml version="1.0" encoding="UTF-8"?>
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
<layout id="bktext">
    New text - Page
</layout>
</page_layouts>

So the page is now visible from the dropdown.

But how can I now make my own design with the normal HTML markup? Just like the old version of Magento where I could edit the .phtml file with just divs and other normal markup.

Is that even possible?

Regards,

Edit:

I just want to make up a file like this:

Header content with menu</header

            Content from the CMS page

Text

Text

Text

Text

Footer content

Is that possible? Instead of using the blocks where I have no idea to edit the files?


texts: Why we are using Capitalization (first letter in caps) in magento?

texts:
Why we are using Capitalization (first letter in caps).

In case of Any folder name like block, model or any controller file name.
But in case of controller folder it's start with small latter.

Also some time in xml file we are using small letter but some time start with Caps.
Like when we write any event name all are in small letter or when we call source in system.xml then we use class name in small letter.
But when we declare the module name in xml then it is start with caps.

Can you please brief me the conditional logic behind it where we have to use small letter and where we have to start with Caps ?


texts:
I am using Magento ver. 2.3.4
How to Remove Post form URL.

Thanks


texts:
When listing product reviews I need to put a tag close to the reviewer name saying "verified customer" however I do not know ho to retrieve this info from the model.

Reviews are returned using this function:

$_items = $this->getReviewsCollection()->getItems();

And user info by this:

foreach ($_items as $_review):

.....

$_review->getNickname()


texts: Magento change `updated_at` field for product by id

texts:
I need to change the updated_at column value for product using it's id.
I've already tried next pieces of code:

$productIds = [26957];
$m = Mage::getSingleton('catalog/product_action');
$m->updateAttributes(
    $productIds,
    array('updated_at' => Varien_Date::now()),
    0
);

Result:

  "Fatal error: Uncaught Exception: Notice: Undefined index: value in app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1495"

And this one:

$productIds = [26957];
foreach($productIds as $id) {
    $product = Mage::getModel('catalog/product')->load($id);
    $product->setUpdatedAt(Mage::getModel('core/date')->gmtDate());
    $product->save();
}

Result:

"Fatal error: Uncaught Exception: Warning: Invalid argument supplied for foreach() in app/code/core/Mage/Eav/Model/Entity/Abstract.php on line 1180"

And this:

$_products = Mage::getResourceModel('catalog/product_collection')
    ->addAttributeToFilter('id', array('in' => array(26957)));
while ($product = $_products->fetchItem()) {
    $product->setUpdatedAt(Mage::getModel('core/date')->gmtDate());
    $product->save();
}

And the result is:

Fatal error: Uncaught Mage_Core_Exception: Product ean is required in app/Mage.php on line 594

How can I do that?


texts: Magento 2 : Sort by custom attribute numeric value

texts:
In magento2, I created a custom attribute in Magento 2 backend and make it use for sorting listings.

The problem is the value is numeric in this attribute EX: (1,4,5,3,7)
other attributes with text value sorting fine in front-end, but only this attribute is not sorting properly with asc/desc numbers.


texts: system.log showing  and no other messages

texts:
I am working locally on an xampp setup.  I am trying to debug a problem using Mage::log() but nothing is showing up in my system.log file.

Every page load just gives me two lines of output:

  2014-03-20T02:46:58+00:00 DEBUG (7):
  2014-03-20T02:47:03+00:00 DEBUG (7):

No matter where I put Mage::log() I still get these two lines.


texts: Magento 2: What is the best way to do caching?

texts:
I'm newbie to Magento 2.

What is the best way to do caching?

Should we use external 3rd party service for it or use default one.

I have more than 1 million SKU's.


texts: How to upgrade magento 2.3.4 community edition to magento 2.3.4 enterprise edition please help me some one

texts:
How to upgrade magento 2.3.4 community edition to magento 2.3.4 enterprise edition
i am getting error when i ran this command composer require magento/product-enterprise-edition 2.3.4 --no-update
the error is  [InvalidArgumentException]
Could not find a matching version of package magento/product-enterprise-edi
tion. Check the package spelling, your version constraint and that the pack
age is available in a stability which matches your minimum-stability (stabl
e).


texts: How do i display 'Store Contact Telephone'?

texts: I have set telephone number from admin panel 'Store Contact Telephone', Now i want to show this number in header, How do i achieve this?


texts: how to show the extension in product page?

texts:
I installed a free extension for Q&A in the following link:
it is supposed to be shown in product details as a form for customers to ask questions

http://www.magentocommerce.com/magento-connect/catalog/product/view/id/22878/s/ds-product-faq/

as we know extension location usually is app/code/local or app/code/community , so I found the extension in app/code/local and in app/etc/modules I have the module also in the back-end admin I can see all the configurations so I think I don't have any problem of installation. I have a custom template and I think that I should have a phtml file for the form but I don't know where it is what is your idea? does it exists? if yes how can I find that I searched many terms and I wasn't successful

therefore I created the phtml file and the layout as follow:

app/design/frontend/enterprise/themename/layout/productfaq.xml

    <?xml version="1.0"?>
<layout version="0.1.0">
    <default>
    </default>
    <productfaq_index_index>
        <reference name="content">
            <block type="productfaq/productfaq" name="web" template="productfaq/productfaq.phtml" />
        </reference>
    </productfaq_index_index>
</layout>

app/design/frontend/enterprise/themename/template/productfaq/productfaq.phtml

also here is the structure for the extension:

-DS
  -ProductFAQ
     -Block
     -Controllers
     -etc

also I have no idea about productfaq_index_index I just wrote it because I don't know which element I should use


texts:
I create a custom payment method, all is working except the title in the checkout.

In the admin, I can see it, all looks good, I can change all and they persist in the database.

I can see the radio button in the checkout (without the title)

I can get in the observer the method by code.

The only part I can't get is the Title, and I don't know if exist some way to get it by their code.

Any idea?

UPDATE

Ok, I tried something and work, but I want to know if my deduction is correct:

protected $_code = 'payment_custom'; //doesn't work with the underscore
protected $_code = 'paymentcustom'; // work

I'm still testing if the code name must be the same as the module_name

makes sense to you?


texts: Form container can't set child form / create form block

texts:
My goal is to have a form into a form container. When I call directly my form in my controller, it works, but when I call the container, I have this issue :

  Fatal error: Call to a member function setData() on boolean in app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php on line 144

The code line is :

public function getFormHtml() {
    $this->getChild('form')->setData('action', $this->getSaveUrl());
    return $this->getChildHtml('form');
}

And this refers to another line :

protected function _prepareLayout() {
    if ($this->_blockGroup && $this->_controller && $this->_mode) {
        $this->setChild('form', $this->getLayout()->createBlock($this->_blockGroup
            . '/'
            . $this->_controller
            . '_'
            . $this->_mode
            . '_form'
            )
        );
    }
    return parent::_prepareLayout();
}

I've tried to tweak values of _blockGroup, _controller and _mode, but nothing works ...

My form container class :

class Cheek_Portraits_Block_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
{
    public function __construct()
        {
            $helper =  Mage::helper('portraits');
            $this->_blockGroup = 'portraits';
            $this->_controller = 'page';
            $this->_mode = 'edit';

            if($this->getRequest()->getParam('id'))
                {
                    $this->_headerText = $helper->__('Edit')." portrait";
                }
            else
                {
                    $this->_headerText = $helper->__('New')." portrait";
                }
            parent::__construct();
        }
}

Here my folders and files :

I also tried like this :


texts:
I am trying to change the quantity input shown on the product page to a select field where the maximum quantity selectable equals the total stock quantity minus quantity in cart.
While this is generally working, I can not get the select to actually add the selected quantity to the cart, instead only one item will be added to the cart.

Here is my code:

<?php
    $onStockQty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);
    $qtyStock = (int)$onStockQty->getQty();
    $inCartQty = Mage::getSingleton('checkout/cart')->getQuote()->getItemByProduct($_product);
    if ($inCartQty) {
        $qtyCart = (int)$inCartQty->getQty();
        $qtySminusC = $qtyStock - $qtyCart;
    }
    $minSaleQty = (int)$onStockQty->getData('min_sale_qty');
    if ($qtySminusC > '99') {
        $qtySminusC = '99';
    }
?>

<select name="<?php echo Mage::helper('core')->quoteEscape($this->__('Qty')) ?>" class="qty" id="qty">
    <?php for($i = $minSaleQty; $i <= $qtySminusC; $i = $i + $minSaleQty) : ?>
        <option value="<?php echo $i?>" <?php echo ($i == $this->getQty())? "selected=selected": ""; ?>>
            <?php echo $i?>
        </option>
    <?php endfor;?>
</select>
<button type="button" title="<?php echo $buttonTitle ?>" class="button btn-qty btn-action" onclick="productAddToCartForm.submit(this)"><?php echo $this->__('Ok') ?></button>


texts: Magento move through shell - after move index.php needed in urls

texts:
Strange issue, I do a backup of folder and database through shell.
I setup the new test shop in a subfolder, change the url etc. All good.
Cleared cache, did a reindex.

Weird issue, after the move I always need webshop/subfolder/index.php/bla otherwise I will get a 404. So suddenly the web rewrite is not working anymore? I also checked if the .htaccess is still there.

Anybody?


texts: Get multiple product images using REST API

texts:
I'm requesting products list using the following API call GET /V1/products

  http://127.0.0.1/magento2github/index.php/rest/default/V1/products?searchCriteria%5BpageSize%5D=100000&searchCriteria%5BcurrentPage%5D=1

That gives me the following response:

{
  "items": [
    {
      "id": 1298,
      "sku": "2000315",
      "name": "testProduct",
      "attribute_set_id": 4,
      "price": 5,
      "status": 1,
      "visibility": 4,
      "type_id": "simple",
      "created_at": "2015-12-29 19:51:31",
      "updated_at": "2015-12-29 19:53:09",
      "weight": 0,
      "product_links": [],
      "options": [],
      "tier_prices": [
        {
          "customer_group_id": 0,
          "qty": 1,
          "value": 5.75
        },
        {
          "customer_group_id": 1,
          "qty": 1,
          "value": 5.75
        },
        {
          "customer_group_id": 26,
          "qty": 1,
          "value": 5.35
        },
        {
          "customer_group_id": 27,
          "qty": 1,
          "value": 5.75
        }
      ],
      "custom_attributes": [
        {
          "attribute_code": "description",
          "value": "
Some description about this item comes here...
"
        },
        {
          "attribute_code": "image",
          "value": "/w/i/wijn1_back_1.jpg"
        },
        {
          "attribute_code": "small_image",
          "value": "/w/i/wijn1_back_1.jpg"
        },
        {
          "attribute_code": "thumbnail",
          "value": "/w/i/wijn1_back_1.jpg"
        },
        {
          "attribute_code": "options_container",
          "value": "container2"
        },
        {
          "attribute_code": "required_options",
          "value": "0"
        },
        {
          "attribute_code": "has_options",
          "value": "0"
        },
        {
          "attribute_code": "url_key",
          "value": "testproduct"
        },
        {
          "attribute_code": "swatch_image",
          "value": "/w/i/wijn1_back_1.jpg"
        },
        {
          "attribute_code": "tax_class_id",
          "value": "2"
        }
      ]
    }
  ],
  "search_criteria": {
    "filter_groups": [],
    "page_size": 100000,
    "current_page": 1
  },
  "total_count": 1
}

If you look at custom_attributes array you will only see the base image. How can I retrieve the other images configured in Magento2?


texts:
Every time I install a new extension from Magento commerce and I return to admin from Magento connect it shows Fetal error class not found in mage.php

please help me with this.

  Fatal error: Class 'Qualityunit_Liveagent_Helper_Data' not found in
  C:\wamp\www\magento\app\Mage.php on line 548


texts: Error connecting MailChimp and Magento 1.9.3 using Magento Connect Manager

texts:
I'm having trouble connecting my MailChimp account to my Magento database and I cannot find a fix on the forums. I'm hoping you can help.

I've obtained the access key for Magento 1.9.3 (Community Edition) and pasted the access key into the Magento Connect Manager. I did do this with the store in maintenance mode, disabled the compiler and flushed and disabled the cache. The
extension is still not pulling through and it's Magento is giving me the following error:

I have tried to change the Magento Connect Channel Protocol settings from HTTP to FTP (as recommended in another post), however, there is no option for FTP, just HTTPS and HTTP. Now, I'm at a bit of a dead end.

Can anyone suggest another path forward?

Many thanks
Annalisa


texts: How can I add an image to view in in magento2?

texts:
... in my phtml view

I want to add a image in my view.

Somebody know how to do it ?

Thanks for help..


texts:
There are some postcodes within countries that are VAT Exempt.
I am wondering if there is a way that in the checkout process, when the customer chooses their shipping address, to then remove the VAT from the totals.

I know there is the Tax Zones and Rates in admin but it doesnt appear to work the way i need it to


texts: Magento 1.9.x "Text Area" attribute displays code instead of rendering it

texts:
Live Demo: https://www.tugasunwear.com/sc-tuga-test#horizontalTab4

Goal: Use existing magento short code (like below) to display a .phtml page in the app/design folder

Code in product attribute textarea:

{{block type="core/template" name="description" template="custom/fabric_care/01.phtml"}}

Code in .phtml file to be rendered:

Imported

Fabric:
80% Nylon&nbsp;/&nbsp;20% Spandex

Care:
Rinse, hand wash, drip dry, do not tumble dry/dry clean/iron, do not dry rolled up

Problem: Magento Short Code is being displayed instead of rendering the code in the .phtml page it is linking to.

Other Info: This attribute is a custom addition into the "Neighborhood" theme by Peerforest - who no longer provides support through themeforest on this theme. I wanted change it to a dropdown from a textarea, but that does not work properly.

This is the code rendering this custom attribute:

<?php $_product = $this->getProduct(); ?>
<?php if($_product->getCustomtext()): ?>
       <?php echo $_product->getCustomtext() ?>
<?php endif; ?>

This is the layout.xml rendering the custom attribute:

<action method="addTab" translate="title" module="catalog">
            <alias>customtext</alias>
            <title>Fabric &amp; Care</title>
            <block>catalog/product_view</block>
            <template>catalog/product/view/customtext.phtml</template>
        </action>

I also added this code change to the output.php file copied to my local code folder (as suggested by this post):

if ($attribute->getFrontendInput() != 'price') {
                  if($attributeName != 'customtext') {
                    $attributeHtml = $this->escapeHtml($attributeHtml);
                  }
                }

Attribute Properties:

Frontend Properties:

If there is more info needed, please let me know. Hopefully this isn't an impossible task.


texts: Set an attribute value in multishop system

texts:
I'm making a cronjob which sets values for a custom global attribute with attribute code 'color_family'. The value that is given is an array (for example $color_families = array(211, 215, 216, 228)), because the type of 'color_family' is "multiple select".

My code for setting the value:

$_product->setData('color_family', $color_families);
$_product->save();

My problem is, that this works only for one store system. When I run the cronjob on multishop system, the value for this attribute is not updated.

I found this online and tried it:

foreach($_product->getStoreIds() as $storeId) {
    $_product->setStoreId($storeId)
         ->setData('color_family', $color_families);
    $_product->save();
}

but that also brought no result.

I'm working on Magento CE v. 1.7.0.2..

I would really appreciate any advice you could give me.


texts: SSL error on Magento 2 Sign In for marketplace

texts:
I have configured a basic install of Magento 2 with a theme for a client.

Magento is running on IIS and Windows. (Not WAMP), shared IIS hosting on windows (My own server).

I configured the shop to use SSL, and the complete shop runs over SSL without any issues.

However, when trying to use the market place, I get a weird SSL issue: "SSL certificate problem: unable to get local issuer certificate" This error is shown on the Magneto shop (which is currently running over ssl), when trying to sign in to the market place.

I have found lots of hits on this issue, but all answers seem to lead to a self-signed certificate that isn't trusted or adding intermediary and/or root certificates. This is all based on XAMP, WAMP or native 'nix installations.

I do not understand what the exact issue is. I also do not know how to troubleshoot this further as the error description is very vague.

I would appreciate some feedback.

Thanks


texts: Change stock availability on attribute drop down change

texts:
On my configurable product page, under the title is a stock availability label that simply says 'in stock'.

I have a dropdown with various color attributes.

I want to make it so when I change the color in the dropdown, the stock availability label is updated to say "We have x products left"

I just need to know where the stock availability label is derived from after the attribute dropdown is changed.


texts:
I currently have a website in Canada and everything is going very well. We would like to start shipping to the United States however we would like to use only 1 Magento.

For example:
www.abc.ca - Canadian dollar
www.abc.com - US dollar

A customer will have the ability to choose the Canadian or the USA store.
However when they are on the USA site, it will go to www.abc.com and if they are in the Canadian site, it will show www.abc.ca.
Can this be done with Magento?


texts:
I have just noticed that we have a problem with our states.
There have been many created manually. This I would now like to be rid of it.
Can I delete the manually created states?
Does anyone know how?


texts: What does each entry in index management actually do?

texts:
I want to have a better understanding of what each entry does and what happens when it requires a reindex.
I've read the Magento Docs fully but they aren't known for breaking down things into the most understandable pieces. I know the difference/functionality of update on save and scheduled. Just not quite sure what it is doing behind the scenes.

Specifically, I do not understand what the entries for :
Rebuild Design Config index and Rebuild customer grid index are for.
Is there a directory I can locate these files in and change them manually?

Any help will be greatly appreciated.