Skip to content

File: vendor/wagento/module-subscription/Model/Cron/Bill.php #6

Description

@pankajrajpurohit

I have found issue when subscription auto-renewal using cron. I have not got any data of auto-renewal in the getActiveSubscriptions function from vendor/wagento/module-subscription/Model/Cron/Bill.php model file. because here join table condition is wrong in the collection query.

Old Code:

$vaultPaymentToken = $connection->getTableName('vault_payment_token_order_payment_link');
$currentDateEnd = $currentDate. ' 23:59:59';
$currentDate.= ' 00:00:00';
$subscriptions->getSelect()->join(
    $vaultPaymentToken . ' as pt',
    "main_table.subscribe_order_id = pt.order_payment_id",
    ['payment_token_id']
);

New Code:

vaultPaymentToken = $connection->getTableName('vault_payment_token_order_payment_link');
$sales_order_payment = $connection->getTableName('sales_order_payment');
$currentDateEnd = $currentDate . ' 23:59:59';
$currentDate.= ' 00:00:00';
$subscriptions->getSelect()->join(
    $sales_order_payment . ' as sop',
    "main_table.subscribe_order_id = sop.parent_id",
    []
);
$subscriptions->getSelect()->join(
    $vaultPaymentToken . ' as pt',
    "sop.entity_id = pt.order_payment_id",
    ['payment_token_id']
);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions